Wish: 2click solid split

This script is designed to cut with any kind of curve, not just lines. So limiting it to infinite planes would remove a whole set of functionality. Also as you can specify multiple objects to cut, an infinite plane would cut through all of them. So the script would then need to be limited to one object at a time to split.

Plus an infinite plane cannot split one of your frame objects at only one spot in any case. As it’s infinite, it will always cut through your fame objects in two spots - so you will get an unwanted cut somewhere.

It doesn’t matter. The result must be two parts,Cutting will definitely lead to two parts, I’m sure I’ll cut it twice,i can combine all parts 。This is the effect in CAD, which operates according to this logic

It does to me…

Hey don’t get too demanding with your free script requests.

Also, maybe you should be trying to actually learn Rhino instead of trying to duplicate every trivial workflow detail from some other software that barely qualifies as 3D.

1 Like

I’m sorry I misunderstood. Your script logic is correct. I can draw multiple line cutting objects. It’s very NICE script. I will test it later. Thank you

The CPLAN mode is not very easy to use. If it is difficult to do so, it is recommended to cancel it,
I suggest putting to draw lines in front of Select cutting curves, and executing draw lines by default. draw lines is used frequently

Well, if you look at the name of the script, it might tell you that is is designed (was originally designed) for trimming “by view”. While you might be working with exclusively mechanical objects and planar surfaces, a few people “sketching” things out using free-form shapes had requested a method of splitting “by eye” in a particular view. Rhino currently only uses the active CPlane to do this so you would need to set the CPlane “To view” for it to work as you want. So the first thing the script accomplishes is removing the need to change the CPlane to split and changing it back again. Plus, when native Rhino’s Split splits solid objects, it leaves them open. To keep things solid you need Wirecut. The script allows you to do both/either.

Actually, from your examples, I think you want the opposite - always in “CPlane” mode and not “View”

…by you. Again, the script was designed to work more or less like Rhino’s normal Split does - with pre-existing curves. The ability to draw lines was added later. I can probably make a version that will only do lines if you want. But remember, for specific types of operations, much of this does not need a script anyway - as Pascal demonstrated with the macro above. Wirecut also has a “draw line” option, however you can only draw one line. The script is a sort of combined tool. Like all combination tools (IRL), if you have just one specific task to do, they are often less well adapted than a tool expressly designed for that task. Yes, you can cut your steak or open a wine bottle with a Swiss Army knife, but it’s much more practical if you have both a real steak knife and a real corkscrew.

1 Like

Here is a version that only uses drawn lines and only cuts along the active CPlane normal direction. Options to extend cutting lines or keep local, plus keep solids solid or not. Will also split curves.

SplitObjsWLines.py (7.2 KB)

1 Like

Thank you very much. You are a very warm and kind superman.

It can only be executed by space, but it is useless to press ENTER
You cannot force the script to exit by pressing ESC

I’m not seeing that, Enter or right mouse button click to accept the lines already drawn works just as well as spacebar.

Yes, that is a limitation of the implementation of how the script is written, it cannot distinguish between an Enter and an Esc pressed after at least one line has been successfully drawn. So it will try to use any valid already drawn lines to split the object, even if Esc is pressed.

I tried to address this by writing a custom GetLine() function that tries to distinguish between an Enter and an Esc. If you hit Esc even after drawing one or more lines, the command is cancelled. If you hit Enter after drawing the lines, the split is executed. Here is a revised version of the script to test.

SplitObjsWLinesRe.py (9.1 KB)