How to get a point cloud from an existing solid model
How to get a point cloud from an existing solid model
(OP)
Does anyone know how to get a point cloud of a surface from an existing solid model? I don't have Solidworks Premium, so unfortunately, I don't have the Scan 2 3D function.






RE: How to get a point cloud from an existing solid model
Usually, point cloud data is used for reverse engineering (i.e. an existing object was scanned).
Which brings up the question, why would you need point cloud data from something that has already been modeled? Would you like to access geometric data from SolidWorks in another software?
RE: How to get a point cloud from an existing solid model
Jeff Mowry
www.industrialdesignhaus.com
Reason trumps all. And awe transcends reason.
RE: How to get a point cloud from an existing solid model
Now, go get the rhino 3d evaluation package. This will read a binary stl. It gives you 25 free saves. You can also delete some of the stuff you may not need, because you must have a solid to export stl from solidworks unfortunately, so it sounds like you only wanted one face. Open up this stl file, delete what you don't want, and then save it back out as points (.txt) file. You now have an nice ascii file of your point cloud.
This is just one way i've skinned this cat.
RFUS
RE: How to get a point cloud from an existing solid model
Thanks for the tip, rfus, I'll check the Rhino 3D package out and see how it works for me.
RE: How to get a point cloud from an existing solid model
Are you just trying to reduce time to create a mesh?
RE: How to get a point cloud from an existing solid model
RFUS
RE: How to get a point cloud from an existing solid model
Rob Stupplebeen
RE: How to get a point cloud from an existing solid model
CODE
Dim swApp As SldWorks.SldWorks
Dim swDoc As SldWorks.ModelDoc2
Dim myBody As SldWorks.Body2
Dim myVertexArray As Variant
Dim myVertex As SldWorks.Vertex
Dim myBodyArray As Variant
Dim myBodyFolder As SldWorks.BodyFolder
Dim myFeature As SldWorks.Feature
Dim XYZ As Variant
Dim fso As Scripting.FileSystemObject
Dim OutFile As Scripting.TextStream
Dim i As Long
Dim j As Long
Sub main()
Set swApp = Application.SldWorks
Set swDoc = swApp.ActiveDoc
Set myFeature = swDoc.FirstFeature
Set fso = CreateObject("Scripting.FileSystemObject")
Set OutFile = fso.OpenTextFile(OUTFILEPATH, ForWriting, True)
While Not (myFeature Is Nothing)
If (myFeature.GetTypeName = "SolidBodyFolder") Or _
(myFeature.GetTypeName = "SurfaceBodyFolder") Or _
(myFeature.GetTypeName = "CutListFolder") Or _
(myFeature.GetTypeName = "SubWeldFolder") Or _
(myFeature.GetTypeName = "SubAtomFolder") Then
Set myBodyFolder = myFeature.GetSpecificFeature2
If myBodyFolder.GetBodyCount > 0 Then
myBodyArray = myBodyFolder.GetBodies
For i = 0 To UBound(myBodyArray)
Set myBody = myBodyArray(i)
If myBody.GetVertexCount > 0 Then
myVertexArray = myBody.GetVertices
For j = 0 To UBound(myVertexArray)
Set myVertex = myVertexArray(j)
XYZ = myVertex.GetPoint
OutFile.WriteLine XYZ(0) & vbTab & XYZ(1) & vbTab & XYZ(2)
Next j
End If
Next i
End If
End If
Set myFeature = myFeature.GetNextFeature
Wend
OutFile.Close
MsgBox "Point data output to:" & vbCrLf & vbCrLf & OUTFILEPATH
End Sub
RE: How to get a point cloud from an existing solid model
RE: How to get a point cloud from an existing solid model