Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have managed to add a cutting plane to model (imported as Model3D then added as content of ModelVisual3D) & it works well but the model is surface & it is open. I want to close the surface with patch/mesh to give illusion it is solid. I understand you get patch mesh detail from MeshGeometry3D but I am struggling to get the conversion from Model to mesh.What is the best way to either import the Mesh from the .stl file or convert.

I undersatnd that you would then create the point3d array like this:-
MeshGeometryHelper.GetContourSegments(mesh, New Point3D(0, 0, 0), New Vector3D(0, -1, 0)).ToArray 

But how do I get to a mesh I don't now I have not this far to try to debug.

Maybe:-
Dim mesh_Out As Mesh3D = New Mesh3D
               For Each s As Point3D In segments
                   meshModel.Positions.Add(s)
               Next


I have looked every where for days & I find promissing things but turn out to be deadends.
Maybe some sample code to help kickstart the momentum.

Thanks in advance.

What I have tried:

Dim group As Model3DGroup = New Model3DGroup
                ModelImporter.Load(My.Application.Info.DirectoryPath.ToString & "\MODEL\" & Model_Name & ".STL")
                Dim TestMesh As MeshBuilder = New MeshBuilder(False, False)
                For Each m In group.Children
                    Dim mGeo = CType(m, GeometryModel3D)
                    Dim mesh As MeshGeometry3D = CType(CType(mGeo.Geometry, Geometry3D), MeshGeometry3D)
                    If (Not (mesh) Is Nothing) Then
                        TestMesh.Append(mesh)
                    End If

                Next
Posted
Updated 9-Oct-20 21:41pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900