Rhino 6 feature request

Hello,

I would recommend to introduce simple parametric options for simple extrude, loft, etc common commands. It is often necessary to change profiles for the model. Profiles could be replaced to another path.

R
Andras

Andras,

If you record history during surface creation, Rhino will allow a surprising amount of modification of the source path and profile curves and still update the surface. You may apply transforms to the path and profile curves such as scale, rotate, continue curve, convert to lines, set points, fillet corners, bend and more. You can point edit, add points or kink points, delete points, rebuild, smooth or fit curve and the surface will update. It’s actually hard to find ways to break the history other than splitting the curve or closing an open curve.

Although one cannot literally replace a curve, I would argue that the transforms available under history allow greater freedom than simple parametric controls. Something like “change the radius of this profile circle to X” is just the beginning of what you can do. (Try BoxEdit for that one, and if the circle is not on a current C-plane, set C-plane to Object and check “Use current C-plane” in BoxEdit.)

As Mark mentioned, it is possible to modify the original profile - even extensively - and maintain the link with the extrusion operation. It’s the same with all the other history-enabled commands that use curves as inputs.

For this reason a while back I wrote a script that modifies a curve (the extrusion profile) to match another one in its entire structure.

It would be great to have this integrated in Rhino6, though.

2015-11-02 - MT_MatchCurveFull.rvb (1.9 KB)

Does this help?

Marco

2 Likes

As @Mark said, History could be a way to go here.
On top of all the operations Mark listed, it is actually possible to use completely new profile or path, instead of just modifying the original one. You would need a script to do that as I don’t think it is possible with regular Rhino commands.
The script (below, actually just copied from RhinoScript help file) simply replaces one geometry with another but maintains its ID and dependencies, so you can change your profile curve or path curve into a newly created one. Should work with many other history operations and types of objects as well.

@pascal - I think it may not be a bad idea to have a regular Rhino command for doing the replacement.

Option Explicit
Call Main()
Sub Main()
	Dim strTarget, strSource
	strTarget = Rhino.GetObject("Select object to replace")
	If Not IsNull(strTarget) Then
		strSource = Rhino.GetObject("Select source object")
		If Not IsNull(strTarget) Then
			Rhino.ReplaceGeometry strTarget, strSource
		End If
	End If
End Sub

hth,

–jarek

7 Likes

That was a nice “hack” Jarek!

Stuff like this should have a propper GUI and be implemented in Rhino. I also think that all extrusion and historyobjects should have a panel with adjustable settings. The data is available to Rhino thus it should be available to the user too.

3 Likes

@Jarek
I didn’t know about the ReplaceGeometry function, thanks for the info!
Sometimes I tend to dive into scripting without looking at the existing methods :smile:

I agree, the history should incorporate some parameter editing functions (another example the count number in the array operations) and it should be extended to some commands like BlendSrf, with a panel for editing the various options (bulge factors etc.) - I’m sure it’s not easy to implement but it would be really great.

1 Like

Note, you won’t find the ReplaceGeometry method in Python rhinoscriptsyntax, but you can use the RhinoCommon scriptcontext function Replace as well:

scriptcontext.doc.Objects.Replace(GUID, geometry)
(Rhino.DocObjects.Tables.ObjectTable.Replace(GUID, geometry)

–Mitch

1 Like

Jarek, It is cool, thanks. Definitely it should be part of rhino.

1 Like

Is this something that can be scripted in Python now? Are there any other new advents or scripts since this old topic that rejuvenates or improves on the functions above and this another old topic (RS - Change object's id)

Thanks

Also another +1 to making some kind of object replacement possible in Rhino, or Grasshopper. By the looks of it, a lot of the underlying functionality is there but needs packing up.

Hi all,

What I think it’s missing for this feature is a UI dialog similar to the Thickness, Edge Softening, Shut Lining ones.

So once I select a curve I go to that dialog, and pick a profile or specify a simple rectangular one.
It will be a lot more user friendly than record history or script.

Thanks!

1 Like

i think it could also do with perhaps a way to keep the input. And maybe the old object then gets reassigned a new GUID

Although on testing this in some cases I am finding that the input isn’t deleted either… and that this is helpful! So maybe, just a ‘DeleteInput=Yes/No’ will suffice.

Do you think the option for DeleteInput is possible? The Replace executes perfectly, but then I’m left with two versions of the replaced object.

It’s a great script I think. Seems a no-brainer for inclusion in Rhino.

Hi @Jonathan_Hutchinson1, yes, definitely possible.
I did not add this as an option when running a script, just modified the original script to delete the redundant copy:

    Option Explicit
    Call Main()
    Sub Main()
    	Dim strTarget, strSource
    	strTarget = Rhino.GetObject("Select object to replace")
    	If Not IsNull(strTarget) Then
    		strSource = Rhino.GetObject("Select source object")
    		If Not IsNull(strTarget) Then
    			Rhino.ReplaceGeometry strTarget, strSource, False
    			Call Rhino.DeleteObject(strSource)
    		End If
    	End If
    End Sub
1 Like

Thanks jarek, that worked great. Would be cool to have as an option in the command line (apologies - I am trying to learn the absolute basics of python, otherwise my scripting knowledge is nil).