88 "runtime/pprof"
99 "time"
1010
11- GDTFMeshReader "github.com/Patch2PDF/GDTF-Mesh-Reader"
11+ GDTFMeshReader "github.com/Patch2PDF/GDTF-Mesh-Reader/v2"
12+ "github.com/Patch2PDF/GDTF-Mesh-Reader/v2/pkg/MeshTypes"
1213 STL "github.com/Patch2PDF/GDTF-Parser/examples/stl"
1314 MVRParser "github.com/Patch2PDF/MVR-Parser"
1415 MVRTypes "github.com/Patch2PDF/MVR-Parser/pkg/types"
@@ -25,8 +26,8 @@ var config = MVRTypes.MVRParserConfig{
2526 },
2627 Individual : map [string ]MVRTypes.ModelNodeConfig {
2728 "FA992217-CB18-D844-9D42-5B791B2BF05E" : {
28- Exclude : & MVRTypes .FalsePtr ,
29- RenderOnlyAddressedFixture : & MVRTypes .TruePtr ,
29+ Exclude : MVRTypes .GetBoolPtr ( false ) ,
30+ RenderOnlyAddressedFixture : MVRTypes .GetBoolPtr ( true ) ,
3031 },
3132 },
3233 },
@@ -56,6 +57,20 @@ func main() {
5657
5758 // write mesh as STL
5859 meshFile , _ := os .Create ("Test.stl" )
59- STL .WriteBinary (meshFile , mvrData .StageModel )
60+ mesh := & MeshTypes.Mesh {}
61+ for _ , fixture := range mvrData .StageModel .FixtureModels {
62+ for _ , part := range fixture .MeshModel {
63+ mesh .Add (& part .Mesh )
64+ }
65+ }
66+ for _ , sceneObject := range mvrData .StageModel .SceneObjectModels {
67+ for _ , part := range sceneObject .MeshModel {
68+ mesh .Add (& part .Mesh )
69+ }
70+ for _ , geometry := range sceneObject .Geometries {
71+ mesh .Add (& geometry )
72+ }
73+ }
74+ STL .WriteBinary (meshFile , mesh )
6075 f .Close ()
6176}
0 commit comments