×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How to get a point cloud from an existing solid model

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

Hi Zubaj,

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

Can you not just copy the surface for what you need?  Or take intersecting contours of the face?  (Just curious why this is needed if you've got the solid model already.)

Jeff Mowry
www.industrialdesignhaus.com
Reason trumps all.  And awe transcends reason.

RE: How to get a point cloud from an existing solid model

Saving as stl essentially tessalates the model into 3 sided polygons. Polygons meet at vertices. Which is a point. So, to increase the density of these verticies go into options on the stl export and crank the tolerance and facing angles way up. Save as an ascii or binary, depending on what program you are going to next. Saving it as an stl ascii gives you a very large file, but if you go in and look at it with wordpad, you'll see its just a format showing how verticies are shared.

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

(OP)
The purpose behind reverse engineering a model is to get a model with less geometrical data that still accurately represents a complex surface.  This is desired to use in finite element modeling to pare down the run time of analyses.  

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

This makes little sense to me.  Usually, once a model is meshed, the surface data does not have anything to do with the analysis.

Are you just trying to reduce time to create a mesh?

RE: How to get a point cloud from an existing solid model

Here's my guess since I used to have to do this stuff in college. He's got some cmd line type exe that was written in fortran or basic that does some type of FEA, and it has to read a point file of nodes, associate some measured data with the nearest node, create a 3x3 tensor on each node, take the eigenvalue of the node, find the principals, and apply whatever calcualations on these principals are needed. XYZ is needed cause its not some fancy FEA package that can read in surface or polygon meshes and remesh it based on some tolerance. Just a guess. I don't ask, I just try and answer the question.

RFUS

RE: How to get a point cloud from an existing solid model

Is it that your FEA program can not glance over surface boundary edges?  Good FEA front ends like Abaqus use "virtual topology" (might be a good buzz word).  Basically it combines the faces into one with an allowable error.  Hope this helps.

Rob Stupplebeen  

RE: How to get a point cloud from an existing solid model

As an alternate to the Rhino route, you could export to STL, then open the STL back up in SolidWorks, and run the following macro to generate a text file of XYZ points.  This macro will export the XYZ points of all vertices in the model.  This macro should work on pretty much any part file, whether it's been STL'd or not, but non-STL'd parts won't have nearly so many vertices.

CODE

Const OUTFILEPATH As String = "C:\OutTest.txt"

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

nice macro handleman

RE: How to get a point cloud from an existing solid model

Thanks... not sure exactly how useful it is, but it did strike me as a quick but interesting challenge to write, so I did.  smile  I'd say I've probably learned about as much about writing code for SW by looking at interesting questions posed here as I've learned by writing stuff for my own use.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources