Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions examples/parse-gdtf.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import (
"log"
"os"

GDTFMeshReader "github.com/Patch2PDF/GDTF-Mesh-Reader"
GDTFMeshReader "github.com/Patch2PDF/GDTF-Mesh-Reader/v2"
"github.com/Patch2PDF/GDTF-Mesh-Reader/v2/pkg/MeshTypes"
GDTFParser "github.com/Patch2PDF/GDTF-Parser"
STL "github.com/Patch2PDF/GDTF-Parser/examples/stl"
)
Expand All @@ -25,11 +26,15 @@ func main() {
fmt.Printf("%+v\n", *gdtf)

// build gdtf model (by dmx mode)
mesh, err := gdtf.BuildMesh("32Ch")
models, err := gdtf.BuildMesh("32Ch")
if err != nil {
log.Fatal(err)
}
// write mesh as STL
mesh := &MeshTypes.Mesh{}
for _, entry := range models {
mesh.Add(&entry.Mesh)
}
f, _ := os.Create("Test.stl")
STL.WriteBinary(f, mesh)
f.Close()
Expand Down
4 changes: 2 additions & 2 deletions examples/stl/stl-writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"encoding/binary"
"io"

"github.com/Patch2PDF/GDTF-Mesh-Reader/pkg/MeshTypes"
"github.com/Patch2PDF/GDTF-Mesh-Reader/v2/pkg/MeshTypes"
)

// helper for `WriteBinary`
func computeNormal(t *MeshTypes.Triangle) MeshTypes.Vector {
func computeNormal(t MeshTypes.Triangle) MeshTypes.Vector {
// edge vectors
a := t.V1.Position.Sub(t.V0.Position)

Expand Down
4 changes: 2 additions & 2 deletions gdtf-parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"log"
"path/filepath"

GDTFMeshReader "github.com/Patch2PDF/GDTF-Mesh-Reader"
"github.com/Patch2PDF/GDTF-Mesh-Reader/pkg/MeshTypes"
GDTFMeshReader "github.com/Patch2PDF/GDTF-Mesh-Reader/v2"
"github.com/Patch2PDF/GDTF-Mesh-Reader/v2/pkg/MeshTypes"
XMLTypes "github.com/Patch2PDF/GDTF-Parser/internal/types/gdtfxml"
Types "github.com/Patch2PDF/GDTF-Parser/pkg/types"
)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/Patch2PDF/GDTF-Parser

go 1.25.4

require github.com/Patch2PDF/GDTF-Mesh-Reader v1.1.2
require github.com/Patch2PDF/GDTF-Mesh-Reader/v2 v2.0.1

require (
github.com/google/go-cmp v0.7.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/Patch2PDF/GDTF-Mesh-Reader v1.1.2 h1:4LHeQjH+cwRoXuv+O4X9YoJaZAO/DihGGN5t3jVIFFk=
github.com/Patch2PDF/GDTF-Mesh-Reader v1.1.2/go.mod h1:4Uipj5UA1HhD3v032aSnEFlpItN80UY5zKB15mIeVwQ=
github.com/Patch2PDF/GDTF-Mesh-Reader/v2 v2.0.1 h1:xc6xxlDRv9s19um206MW6lYsZU7sXOfHgROuo7PxTZg=
github.com/Patch2PDF/GDTF-Mesh-Reader/v2 v2.0.1/go.mod h1:zAcGHlYdE75hdFo624nQfQHTzw9+NfPJT8Eo2mB1lI8=
github.com/go-test/deep v1.0.1 h1:UQhStjbkDClarlmv0am7OXXO4/GaPdCGiUiMTvi28sg=
github.com/go-test/deep v1.0.1/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
Expand Down
Loading