Wish: Extend all curves within closed volume without clicking curve ends

Hello again.

I have lots of these units with vairations and I need to extend both curve ends within a kind of shape ( here for this example, a rectangle). I tried extendcrv select rectangle as boundary object, and then select the curves as requested (selcrv), but none of the extension is done. As I know, this command needs me to pick curves end….see how many clicks do i need here, and micro zoom in to each curve end and zoom out.

So I hope, this command will be improved. Or is there any better ways that I did’t explore? Thanks.

Extendcurveswithout clicking.3dm (78.2 KB)

I hacked out a quickie script for you to try…

ExtendCrvsBothEndsToBoundary.py (675 Bytes)

Edit:
Guess I didn’t necessarily need to limit it to just one brep for the boundary objects.

ExtendCrvsBothEndsToBoundaryObjs.py (739 Bytes)

4 Likes

This is awesome! Thanks!:grinning_face:

This is a great tool! But multiple boundary objects give inconsistent results:

Inner and outer box - curves extend to inner.
Overlapping boxes - seemingly random extension to boundaries.
Disjoint boxes - curves extend to closest face of non-enclosing box.

Sorry!
Jeremy

Yeah, figured as much, that’s why I limited it to one BREP in the first try. The second one should work fine for specific situations such as between just two boundary surfaces, but I was pretty sure Rhino wouldn’t necessarily be able to sort out more complex boundaries. FWIW

1 Like

I shared it into the common topic here, because it’s too important to be missed. :slight_smile:

1 Like

Hello Helvetosaur, I found that your script which were perfect are no longer workable after some automatic updates of rhino. After I perform the script, it will freeze all views and I need to restart Rhino.

Do you have I file I can test with?

Thanks for quick reply, and yes I should have the file prepared:

Script display failure.3dm (130.5 KB)

This is how the views look like. They are freezed. I have to save the file immediately and restart Rhino.

Besides, I would like the shorter group of curve extend in straight line. Is it possible.

Many thanks for your help.

Hi, I am not seeing a lockup here with the latest V8 Service Release Candidate - 8.25.25287.14001, 2025-10-14

Note the following - the script is currently set up to extend curves “smooth” - that is to say as if you used the Rhino command _Extend with the smooth option - it tries to extend NURBS curves “naturally” so that they remain continuous. There are options for linear or arc extensions as well in both the Rhino command as well as script-wise; below are scripts that will extend all curves by lines or arcs. With these simple scripts, it is not possible to choose which curves get extended naturally, with a line, or with an arc, so you will have to do them separately for each extension type. Non-‘natural’ extensions will result in polycurves.

ExtendCrvsByLineBothEndsToBoundary.py (687 Bytes)
ExtendCrvsByArcBothEndsToBoundary.py (685 Bytes)

Please note: Your short curves have a tiny hook at the ends - there are two control points that are 0.001mm from each other at the ends - not a good situation. A natural extension would not actually reach the walls of the box (why the original script doesn’t work on them); if you try with Extend>Dynamic>Natural you will see that Rhino even wants to extend them backwards. Linear extensions meet your box for only two out of the four curves.

1 Like

Thanks for quick reply.

Here is the video screen cap, i hope it can play here:

And yes I noticed the crvend situation. It was a surface of STEP file from client, they are not expert in surface concepts.

I love your script that can extend all isocurves, and I will try your new scripts tomorrow, off work now. Thank you.

What version of Rhino are you running?

When the freeze happens, if you type at the command line _SetRedrawOn and Enter - if you can’t get to the command line, just try typing it anyway - does the screen refresh and can you work? The script cuts the display redraw and I’m wondering if it is not getting restored automatically.

Good morning, work again. Thanks for quick reply, and yes I need to run _SetRedrawOn after script is run. My rhino version is the most update: Version 8 SR25 (8.25.25287.14001, 2025-10-14)

Thank you so much for this very helpful script. I really love it.

Hmm, OK, there is something odd with your installation… Python scripts are supposed to reinstate the redraw automatically immediately after the script completes. This appears to be failing on your end. I can modify the scripts to force redraw back on, but that shouldn’t really be necessary, and it appears nobody else is reporting a problem right now.

1 Like