Importing point cloud in single plane from a comma delimited file

Importing point cloud in single plane from a comma delimited file

housermp
Contributor Contributor
4,010 Views
9 Replies
Message 1 of 10

Importing point cloud in single plane from a comma delimited file

housermp
Contributor
Contributor

What I'd like to do:  Import a part scan (x,z, data points- in a single plane) from a .txt file.  Then, sketch  arcs and lines to recreate the scanned contour.  Finally the coutour has to be offset to correct for the diameter of the scan probe tip creating actual part contour.

 

We can do this in Mastercam but find that the sketching tools are  easier/friendlier to use in Fusion 360.

 

I can import a dxf file of the points created in Mastercam however the imported points are scaled differently.

Is there a wa to correct for the scaling?  Is it possible to import a comma delimited file into fusion?

 

0 Likes
4,011 Views
9 Replies
Replies (9)
Message 2 of 10

innovatenate
Autodesk Support
Autodesk Support

 

You should be able to scale a sketch in Fusion 360, using the Scale command found in the Modify drop down menu. This may help get your points to be the correct size.

 

 

scale feature in fusion 360.png

 

 

Another option may be to try and get your scan data in a mesh file format (STL or OBJ). When performing a Create Base Feature or a Create form feature, you'll find an Insert Mesh command available.

 

Insert mesh feature in fusion 360.png

 

 

This may allow you to do something similar to rebuild the scanned data natively in Fusion 360.

 

In the file menu, in scripts and Add-Ins, there is a script to create a spline from a CSV file. It may be possible to modify this script to create sketch points. I'll do some more digging on this and get back to you.

 

Thanks,

 

 

 




Nathan Chandler
Principal Specialist
0 Likes
Message 3 of 10

innovatenate
Autodesk Support
Autodesk Support

If you willing to try, it seems that you can edit the ImportSplineCSV sample to generate sketch points instead of a spline. This would be a good exercise for anyone beginning with the API (myself included).  All it would take would be to replace the:

 

sketch.sketchCurves.sketchFittedSplines.add(points)

 

line in ImportSketchPointCSV.py with:

 

for point in points:

    sketch.sketchPoints.add(point)

 

I hope that helps. Let me know if you have any questions.

 

Thanks,

 

 




Nathan Chandler
Principal Specialist
0 Likes
Message 4 of 10

housermp
Contributor
Contributor
 I'd be willing to give the line substitution a try.  I have no experience with Python or script writing but I assume the file can be modified with a simple text editor or something downloded from Python?  Where can I find  ImportSketchPointCSV.py?  I'll need some hand holdingto get started.
Thanks- dave
0 Likes
Message 5 of 10

innovatenate
Autodesk Support
Autodesk Support

 

I think I can save you some pain here. I missed a for loop in my follow up comments. 

 

Try using the .py file in the attachment and let me know if it works for you or if you have any questions. 

 

 

Thanks,




Nathan Chandler
Principal Specialist
0 Likes
Message 6 of 10

housermp
Contributor
Contributor
Thanks I'll give it a try. I've been away on business but still very interested.
0 Likes
Message 7 of 10

antti_lehtonen
Explorer
Explorer

Hi,

I have hard time to get this fix to work, if I manually edit, script stops to work, or if I use the downloaded version, I dont get any points to my sketch, it will make new one still. Is it possible that there is some changes on Fusion over the years make this need some other tweaks?

 

I would really appreciate this kind of functionality to add points from .csv

0 Likes
Message 8 of 10

Anonymous
Not applicable

I tried this script but when I try to run it I get this error message after selecting a .csv

Screen Shot 2020-11-25 at 3.05.15 PM.png

Message 9 of 10

etfrench
Mentor
Mentor

Verify there is no non-numeric data in your .csv file.

ETFrench

EESignature

0 Likes
Message 10 of 10

rpatel
Community Visitor
Community Visitor

Make sure you save the file as CSV (Comma delimited), not CSV UTF-8 

 

rpatel_0-1643316658136.png

 

0 Likes