Skip to content

Migrate WritePoint to unsafe native pointer and split LasPoint.cs#12

Merged
Kuoste merged 2 commits into
mainfrom
11-migrate-writepoint-native-split-laspoint
Mar 11, 2026
Merged

Migrate WritePoint to unsafe native pointer and split LasPoint.cs#12
Kuoste merged 2 commits into
mainfrom
11-migrate-writepoint-native-split-laspoint

Conversation

@Kuoste

@Kuoste Kuoste commented Mar 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Consolidate around LasZipPointNative for both read and write paths, replacing Marshal.StructureToPtr with direct unsafe pointer writes in WritePoint. Split the multi-type LasPoint.cs file into one-type-per-file.

Changes

  • LasZipPointNative.cs (new) — extracted struct + added WriteFromLasPoint for the write path
  • LasZipPointStruct.cs (new) — extracted struct marked [Obsolete], retained for backward compatibility
  • LasPoint.cs — trimmed to only contain the LasPoint class
  • LasZip.csWritePoint rewritten to use unsafe LasZipPointNative* pointer writes

Bug fix

The old WritePoint was mutating the caller's point.X/Y/Z to scaled integer values before writing. The new implementation writes directly to the native pointer without modifying the input.

Closes #11

Kuoste and others added 2 commits March 10, 2026 14:34
- Extract LasZipPointNative to its own file with new WriteFromLasPoint method
- Extract LasZipPointStruct to its own file, marked [Obsolete]
- Rewrite WritePoint to use LasZipPointNative* instead of Marshal.StructureToPtr
- Remove legacy ConvertPoint(LasZipPointStruct) overload from LasPoint
- Fix bug where old WritePoint mutated caller's point coordinates

Closes #11
@Kuoste Kuoste merged commit 376a254 into main Mar 11, 2026
4 checks passed
@Kuoste Kuoste deleted the 11-migrate-writepoint-native-split-laspoint branch March 11, 2026 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate WritePoint to unsafe native pointer and split LasPoint.cs

1 participant