Solutons Lounge

How to “3d-crop” a complex model with ruby – Ruby API


I want to cut out a part of a non-trivial model programmatically. Preferably preserving everything within an arbitrary boundingbox.
My impression is that people use one of a number of extensions for doing this within the GUI, and that the closest built in option is “Intersect Faces>With Model” (that will leave a lot of manual work if the model is complex).

How could I accomplish this in ruby ?

intersect_with(), and then iterate all objects (recursing groups and components) and removing all that is outside the bounding box ?

Are there extensions that could be used programmatically ?

Perhaps Eneroth’s Solid Tools ?

thanks, tried eneroth solid tools, it didn’t allow me to select the component I want to crop, it’s a component with multiple levels of inner components, so maybe too complex, I don’t know the definition of “solid” but I assume my component is not a solid.

Eneroth slicer does can slice my component correctly, but maybe not so easy to use programmatically.

Please expand on your notion of “cut out a part”. Better clarity will help us ponder how your goal might be achieved (I don’t know of an existing extension that crops 3D without requirements on the model itself, such as everything being solids).

You wrote “preserving everything within an arbitrary bounding box”. What is your definition of “thing”: edges, faces, groups, components, texts, dimensions…?

What should happen to things that protrude through the bounding box? Should they be jettisoned entirely, retaining only things completely inside the bounding box? Should they be clipped off at the boundary, as would happen during a 2D image crop operation? If so, what should happen with the newly terminated edges, sliced faces, and chopped groups and components? Should new geometry be created in an effort to make things whole again? What would the repaired fragments come to represent in the model (e.g. what does one do with half a house)?

What is your downstream use of the cropped model? Do you need to continue working with it? Do you just need a view of it?

How well structured in the model itself? Does it make good use of tags, groups and components, or is it a mass of loose edges and faces?

Others can no doubt raise additional questions, but that’s enough for now.



Source link

Exit mobile version