I’m wondering if there’s a way to have an adjustable tolerance for this command so that when I select regions to CurveBoolean, that it will ‘jump the gaps’ in a similar way to how Illustrator can do this with the Paint Bucket tool?
No, I don’t think so. I think you need to have all the curves at least touching/crossing within the file absolute tolerance to be able to form closed regions. You could of course lower the tolerances temporarily to be bigger than the largest gap, but that’s playing with fire - first, you don’t know how exactly Rhino will connect those and second, if you forget to set it back to a correct tolerance later, you will likely create inaccurate geometry.
If I was to click within this region, CurveBoolean wouldn’t work because it’s not 100pc closed. But if there was a method like as is seen in illustrator’s gap options, it would likely be useful.
@jdelavaulx
You could try this script - it extends all selected open curves by a length (user input), if you give it a length more than the biggest gap, maybe it will create enough overlaps to close the figure afterward with CurveBoolean.
Hi, I’m sorry to reopen this, but can I ask if there is a way to extend those curves to an intersection rather than by a set distance? How would I recode this as a python newb? Thanks
Currently, the RhinoCommon methods where curves can be extended to boundary objects are limited to where the intersection can actually be found - without extending the boundary objects. i.e. no “virtual” intersections are found.
So the blue curves below can be extended via script to meet the red:
OTOH, the figure below doesn’t work because no valid boundary geometry is found when extending either the red or blue curves using the others as boundary geometry:
It might be possible to look for the pairs of “nearest neighbor” endpoints and then try to connect them, but that is assuming some things about the geometry that might not necessarily be true. Could work in many cases but fail in others.
Is there a method then to trim excess ends of curves where curves intersect? For example, there are often images of people in CAD block format that are not fully closed. Generally, it’s advantageous to have them closed so you can create an additional silhouette around them in a darker line weight and can close the object with a white background in illustrator. This script allows me to extend the lines, but then I have to manually trim each one. I can highlight the intersections using the intersect command, but there has to be a better of way of adding into the script the trim component.
I have tried on GH as well but that is extremely complicated and the system does not understand which lines are the ones that require trimming. You are forced to explode the curve using a shatter component and then this creates a totally segmented curve on top. I am not much of a scripter, so appreciate all help.
Once the curves all overlap so that intersections can be found, Rhino native CurveBoolean will work to actually create the region. GH has a component for that IIRC, otherwise make a boundary surface and get the outer edges.
Edit - actually there is no region creation component in GH and Boundary Surfaces does not work on overlapping curves. Looks like you need a plug-in like Flexibility or others. Or a custom script.
Thanks Helvetosaur. The problem is I want the interior curves trimmed as well, otherwise they will either be not touching or overlapping in the final file. Getting the CurveBoolean silhouette is definitely helpful, but the detail needs to be clean for architectural linework. Is there no way to clean those ends up without a manual trim?
Sorry for the delay, I was dealing with finals. Here is an example of a CAD block figure. As you can see they have plenty of gaps. Currently I:
Join All Curves
RunPythonScript ExtendCrvsBothEndsLen.py
Trim the edges
Curveboolean for the silhouette.
The target is to identify curves that are close to being closed, perhaps within 0.5" in this case and then close them. Right now, this python script is unfortunately extending all curves at both ends which is unnecessary. I would like to try and automate this a little better if possible.