File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 "log"
66 "os"
77
8- GDTFMeshReader "github.com/Patch2PDF/GDTF-Mesh-Reader"
8+ GDTFMeshReader "github.com/Patch2PDF/GDTF-Mesh-Reader/v2"
9+ "github.com/Patch2PDF/GDTF-Mesh-Reader/v2/pkg/MeshTypes"
910 GDTFParser "github.com/Patch2PDF/GDTF-Parser"
1011 STL "github.com/Patch2PDF/GDTF-Parser/examples/stl"
1112)
@@ -25,11 +26,15 @@ func main() {
2526 fmt .Printf ("%+v\n " , * gdtf )
2627
2728 // build gdtf model (by dmx mode)
28- mesh , err := gdtf .BuildMesh ("32Ch" )
29+ models , err := gdtf .BuildMesh ("32Ch" )
2930 if err != nil {
3031 log .Fatal (err )
3132 }
3233 // write mesh as STL
34+ mesh := & MeshTypes.Mesh {}
35+ for _ , entry := range models {
36+ mesh .Add (& entry .Mesh )
37+ }
3338 f , _ := os .Create ("Test.stl" )
3439 STL .WriteBinary (f , mesh )
3540 f .Close ()
Original file line number Diff line number Diff line change @@ -4,11 +4,11 @@ import (
44 "encoding/binary"
55 "io"
66
7- "github.com/Patch2PDF/GDTF-Mesh-Reader/pkg/MeshTypes"
7+ "github.com/Patch2PDF/GDTF-Mesh-Reader/v2/ pkg/MeshTypes"
88)
99
1010// helper for `WriteBinary`
11- func computeNormal (t * MeshTypes.Triangle ) MeshTypes.Vector {
11+ func computeNormal (t MeshTypes.Triangle ) MeshTypes.Vector {
1212 // edge vectors
1313 a := t .V1 .Position .Sub (t .V0 .Position )
1414
Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ import (
1111 "log"
1212 "path/filepath"
1313
14- GDTFMeshReader "github.com/Patch2PDF/GDTF-Mesh-Reader"
15- "github.com/Patch2PDF/GDTF-Mesh-Reader/pkg/MeshTypes"
14+ GDTFMeshReader "github.com/Patch2PDF/GDTF-Mesh-Reader/v2 "
15+ "github.com/Patch2PDF/GDTF-Mesh-Reader/v2/ pkg/MeshTypes"
1616 XMLTypes "github.com/Patch2PDF/GDTF-Parser/internal/types/gdtfxml"
1717 Types "github.com/Patch2PDF/GDTF-Parser/pkg/types"
1818)
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ module github.com/Patch2PDF/GDTF-Parser
22
33go 1.25.4
44
5- require github.com/Patch2PDF/GDTF-Mesh-Reader v1.1.2
5+ require github.com/Patch2PDF/GDTF-Mesh-Reader/v2 v2.0.1
66
77require (
88 github.com/google/go-cmp v0.7.0
Original file line number Diff line number Diff line change 1- github.com/Patch2PDF/GDTF-Mesh-Reader v1.1.2 h1:4LHeQjH+cwRoXuv+O4X9YoJaZAO/DihGGN5t3jVIFFk =
2- github.com/Patch2PDF/GDTF-Mesh-Reader v1.1.2 /go.mod h1:4Uipj5UA1HhD3v032aSnEFlpItN80UY5zKB15mIeVwQ =
1+ github.com/Patch2PDF/GDTF-Mesh-Reader/v2 v2.0.1 h1:xc6xxlDRv9s19um206MW6lYsZU7sXOfHgROuo7PxTZg =
2+ github.com/Patch2PDF/GDTF-Mesh-Reader/v2 v2.0.1 /go.mod h1:zAcGHlYdE75hdFo624nQfQHTzw9+NfPJT8Eo2mB1lI8 =
33github.com/go-test/deep v1.0.1 h1:UQhStjbkDClarlmv0am7OXXO4/GaPdCGiUiMTvi28sg =
44github.com/go-test/deep v1.0.1 /go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA =
55github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8 =
You can’t perform that action at this time.
0 commit comments