Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
CSV point cloud import to create a 3D spline

Can anyone help me with this idea? I'd like to import cloud point data (3D spline data) from a .csv file. Is there a way to do that? Then, once it's imported, how can I create a spline path through the points?
Best Answers
-
GregBrown Member, Onshape Employees, csevp, pcbaevp Posts: 272
Is the csv data unstructured, in that are the points in random order in the CSV? Or are they in order that they could be sensibly placed into a spline?
If it is the latter then there are a couple ways shown in this doc:
https://cad.onshape.com/documents/28e76ab7f54b1ca7109910cc/w/96a9c071d8d1a5b142307591/e/b73a7f2aea5bb6726e628167The first Part Studio has a Routing curve custom feature: this is my recommendation, as it has a lot of powerful editing controls beyond just processing a CSV and making a spline (for instance you have use manipulators to move any of the points, you can add/delete points, you can make into a polyline or interpolated spline. etc…
The second Part Studio has a quick custom feature I wrote (before the Routing curve existed) that was purpose built for CSV- to-spline. It has far more limited options. I know of a bunch more custom features out there, but this should get you started.If the data is truly random (point cloud) and you'll need to make some manual decisions on which points to include/skip, and in what order, then I guess you could use the second CSVxyz custom feature and uncheck the create curve option. Then you'd just have the points. You could then create a 3D fit spline through whichever points you desire. (I showed this in the third Part Studio)
0 -
GregBrown Member, Onshape Employees, csevp, pcbaevp Posts: 272
I had a quick look - there are 4453 points in the file, so it is a lot heavier than might be wise for my CSVxyz feature…
However it did process it in a few seconds - appears that Y is "up" in your data?
This is just using columns 1,2,3 of your data - my feature does not set up to do any more than that.
PS For any Custom feature you see in the feature list, just right click on it and choose "Open linked document". This will take you to the document where the Custom feature is defined. Up the top of the screen you'll see a button to add it to your toolset:0
Answers
Is the csv data unstructured, in that are the points in random order in the CSV? Or are they in order that they could be sensibly placed into a spline?
If it is the latter then there are a couple ways shown in this doc:
https://cad.onshape.com/documents/28e76ab7f54b1ca7109910cc/w/96a9c071d8d1a5b142307591/e/b73a7f2aea5bb6726e628167
The first Part Studio has a Routing curve custom feature: this is my recommendation, as it has a lot of powerful editing controls beyond just processing a CSV and making a spline (for instance you have use manipulators to move any of the points, you can add/delete points, you can make into a polyline or interpolated spline. etc…
The second Part Studio has a quick custom feature I wrote (before the Routing curve existed) that was purpose built for CSV- to-spline. It has far more limited options. I know of a bunch more custom features out there, but this should get you started.
If the data is truly random (point cloud) and you'll need to make some manual decisions on which points to include/skip, and in what order, then I guess you could use the second CSVxyz custom feature and uncheck the create curve option. Then you'd just have the points. You could then create a 3D fit spline through whichever points you desire. (I showed this in the third Part Studio)
@GregBrown Many thanks! You're definitely a much more advanced user than I am…. I'm using an Onshape EDU account (does not have Enterprise capabilities). The spline you showed is complex enough to make me think your solution will work for us.
I'm teaching engineering seniors at CalStateLA. One of my teams is building a model roller coaster. Hence the need of a track spline. I have exported the csv from a Steam model. I think that the points are close enough together that if the function just looks for the next closest cloud point, the spline should create correctly.
I see the Router curve feature in your model, but cannot find that custom feature in an Onshape library. How can I get that to try it out?
In case you have the time to review this - I've attached the csv here.
I had a quick look - there are 4453 points in the file, so it is a lot heavier than might be wise for my CSVxyz feature…
However it did process it in a few seconds - appears that Y is "up" in your data?
This is just using columns 1,2,3 of your data - my feature does not set up to do any more than that.
PS For any Custom feature you see in the feature list, just right click on it and choose "Open linked document". This will take you to the document where the Custom feature is defined. Up the top of the screen you'll see a button to add it to your toolset:
@GregBrown This is amazing and perfect! I was able to copy the Routing Curve CF to my tool menu. Do you have any user reference notes? …basically, I don't know how to use it!
Did you modify the csv file to parse the Row Number, and X,Y,Z points into separate columns? Did you have to import the csv to the Onshape document before running the CF? How does the CF get the csv input?
@GregBrown Perhaps you didn't see my last post. I'm in the dark about how to use the Routing Curve CF. It's a perfect solution. Looking forward to your help!
@GregBrown It took a little more support and persistence, but I got it to work! Thank you SO much for the Routing Curve cf.