Does anyone have a script that will produce a 2D outline of a solid object?
Imagine a truncated cone that leans over so that in plan the top surface is partially leaning out over the base.
Consider also that is a vertical cylindrical hole cutting through the object.
I need a script for 2D cnc cutting where the result will give me the projected outline (topview) of the maximum perimeter and will also outline the holes and include the projected tangent lines.
The attached model is typical, however there are over 300 unique pieces to do at once.
Hi, if polylines are fine then you can use the _MeshOutline command from Top view. It is using the render mesh so you might adjust that to get the resolution you need.
The Silhouette command creates edge curves of all the surfaces making up each solid. These are 3D curves. Using projecttocplane or setpt will flatten them but you still need to resolve duplicates and create an overall outline. I have found the ceateoutline.rvb file but you still need to go through the silhouette stage and flatten the curves first, but the result loses the hole details.
I have been told there is a âboundaryâ command in AutoCAD that will do it but I canât find the equivalent in Rhino.
How about getting MeshOutline and running Rebuild command on the result, with Degree 3 and 20-30 points?
Depending on the scale of your project, the deviation is minimal and you will get rid of the segmented outlines.
Iâd still have to go around and split all the corners before rebuilding otherwise they would round off.
Iâd then have to rejoin to get closed loops.
The attached screenshot shows a few of the real objects. There are 322 in this file Each piece is 18mm thick with curved sloping sides at varying angles. They are not vertical, All pieces have at least 2 x 12mm diameter holes. The attached image does not show all the holes because of the resolution.
In the largest model, yet to be considered, there will be over 1200 pieces.
The problem is so large that I really am looking for a script such as that described in my original post. I have tried various stopgaps and workarounds but it is still a very long process.
Here is a script that would do rebuild of multiple curves based on the max. distance between curve points and will keep the corners (based on the threshold angle). It may work for you if you use MeshOutline and then run the script on the result to get rid of the segmentation.
The problem stuck with me today, are you going to script this yourself?
first to make sure I have the conditions right:
You have 18 mm thick polysurfaces with both circular and rectangular holes.
Are all the holes (circular and rectangular) are vertically extruded (or can they be sheared as well?)
The polysurfaces are all âlaying flatâ on the XY plane
What you need is the maximum perimeter of te polysurface and the outline of the vertical holes all as curves on a flat plane XY plane.
I think it can be scripted like so:
2 step approach:
Step 1:
Via the silhouette command coupled with a CurveBooleanUnion you get the outline of the object ( no holes yet)
Step 2:
Extract all the edge curves of the bottom surface and delete only those that intersect with the found perimeter in step 1.Thus leaving the hole curves as they do not intersect the perimeter.
The final structure is to be assembled from layers of plywood but only 3 axis machining is available. The idea is to cut the shapes out with entirely vertical cuts in one pass following the boundary shapes. The round holes will be drilled and will enable the use of dowels to keep the parts correctly aligned. The larger ârectangularâ cuts are to reduce weight.
The final assembly will be âsteppedâ. The next stage is a lots of planing and sanding.
Time scale ? I am in the middle of it right now. I didnât have this problem until I started it.
If doing this without a script, perhaps Make2D instead of silhouette would be better because silhouette will create 3 curves at each dowel hole, whereas Make2d will create one, which will make later selection easier in the following method:
Make2d your solids in top view;
Create polylines or rectangles to suit, around all or parts of the geometry;
CurveBoolean onto a new layer for the external boundaries;
CurveBoolean again into the large lightening openings;
Finally move all the dowel circles onto the new layer, this may take a while, but if the new layer is turned off you will see them disappearing which speeds things up in your headâŚ
Hi Bill, actually it is possible to cut the sloped edges with a 3 axis machine. You just cannot do the undercuts. For these youâll have to flip the plates and use the holes for positioning. It will save a lot of manual work.
However, it is easily possible to do what you are looking for with a combination of some scripting and a bit of manual modeling. It may be hard to develop a âfoolproofâ fully automatic tool. It depends a bit on the quality and consistency of the model geometry.
So the question is: Do you plan to do this frequently or is it just a one-time job?
Itâs not a fullproof script but it might do the job, I do have some error checking and reporting build in in case no outlines are found.
To run it: open python editor: _EditPythonScript
open the saved scriptfile via File menu
Next run the script via the green arrow button
follow the instruction in the commandline
First dialog is to make sure you are working in topview with correct cplane.