1
$\begingroup$

I have an .STL file (ascii and binary format) that contains several different CAD models. How can I read the file and create separate .stl files for each of the single different models. Even some hints/reference would be helpful.

$\endgroup$
1
  • $\begingroup$ Questions asking us to recommend or find a book, tool, software, tutorial or other off-site resource are off-topic for Computer Graphics as they tend to attract opinionated answers and spam. I have edited to remove that request, so that the question need not be closed. If this changes your intention in other ways, please edit to correct this. $\endgroup$ Apr 21, 2016 at 11:20

1 Answer 1

1
$\begingroup$

Software recommendation are not on topic. Instead I will explain how you separate the shapes. Each object is a separate volume so you can just extract all the continuous shells. You can do this simply by picking a vertex marking it as visited and then picking all connected vertices and marking them visited. You continue this visiting to new un-visited vertices until you no longer can find a connected vertex.

This is a shell, in most cases a shell is a separate object. Unless there is a empty non connected cavity inside the object. This is rare but possible in 3d printing though not most other manufacturing methods. In this case you need to check that the shells do not intersect (they shouldn't or it means your model is broken anyway, nothing to fix) and if a shell lies inside another. You can do this by picking a point on the suspected interior shell and shooting a ray in a arbitrary direction. The shells that you hit a odd number of times are surrounding your main shell.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.