I apologize if this is a basic question but I am a bit confused on how to import a point cloud using a DMesh3. I follow the last tutorial and this is what I got so far:
`
Dim tri As Integer() = New Integer() {}
Dim pts As List(Of g3.Vector3d) = New List(Of g3.Vector3d)
Dim nrm As List(Of g3.Vector3d) = New List(Of g3.Vector3d)
Dim pointSetBuilder As g3.DMesh3Builder = New g3.DMesh3Builder()
For Each pt In imputPoints
pts.Add(New g3.Vector3d(pt.x, pt.y, pt.z))
nrm.Add(New g3.Vector3d(pt.normal.x, pt.normal.y, pt.normal.z))
Next
Dim mesht As g3.DMesh3 = g3.DMesh3Builder.Build(pts, tri, nrm)
Dim pointSet = mesht
Dim pointBVTree As g3.PointAABBTree3 = New g3.PointAABBTree3(mesht, True)
Dim areas As Double() = New Double(pointSet.MaxVertexID - 1) {}
For Each vid As Integer In pointSet.VertexIndices()
pointBVTree.PointFilterF = Function(i) i <> vid
Dim near_vid As Integer = pointBVTree.FindNearestPoint(pointSet.GetVertex(vid))
Dim pt As g3.Vector3d = pointSet.GetVertex(vid)
Dim ptt As g3.Vector3d = pointSet.GetVertex(near_vid)
Dim dist As Double = Math.Sqrt((pt.x - ptt.x) * (pt.x - ptt.x) + (pt.y - ptt.y) * (pt.y - ptt.y) + (pt.z - ptt.z) * (pt.z - ptt.z))
areas(vid) = g3.Circle2d.RadiusArea(dist) * factor
Next
pointBVTree.FWNAreaEstimateF = Function(vid) areas(vid)
pointBVTree.FastWindingNumber(g3.Vector3d.Zero)
Dim mc As g3.MarchingCubes = New g3.MarchingCubes()
Dim Implicit = New PWNImplicit()
Implicit.Spatial = pointBVTree
Implicit.Bounds()
mc.Implicit = Implicit
mc.IsoValue = 0.0
mc.CubeSize = pointBVTree.Bounds.MaxDim / 12.5
mc.Bounds = pointBVTree.Bounds.Expanded(mc.CubeSize * 3)
mc.RootMode = g3.MarchingCubes.RootfindingModes.Bisection
mc.Generate()
Dim resultMesh As g3.DMesh3 = mc.Mesh
`
The resultMesh have 0 vertex and 0 meshes. Thanks for the help. I really appreciate it!
Hello,
I apologize if this is a basic question but I am a bit confused on how to import a point cloud using a DMesh3. I follow the last tutorial and this is what I got so far:
`
Dim tri As Integer() = New Integer() {} Dim pts As List(Of g3.Vector3d) = New List(Of g3.Vector3d) Dim nrm As List(Of g3.Vector3d) = New List(Of g3.Vector3d)
`
The resultMesh have 0 vertex and 0 meshes. Thanks for the help. I really appreciate it!