How does replace edge work?

Watching one of @Rhino_Bulgaria’s videos recently I learned about the ReplaceEdge command which seems like a nice solution for when a untrim gives back too much of the surface, however I haven’t managed to find any tutorial videos for that feature, and when I tried it on something I expected to work, I got this:

Yes, that curve isn’t exactly on the surface, but even when I extruded in both directions and created an intersection curve with the untrimmed surface (something that completely defeats the better workflow that I expected this tool to provide), I got the same result.

replaceedge.3dm (166.3 KB)

In cases like that I’d do an _Untrim with keep trim objects, _Explode the curve, remove the parts you want to replace from the selection, add the new trim curve and _Trim again.

In this case it won’t work because the upper edge also needs to be replaced (untrimmed in this case)

However if you would feed it this curve it will work:

This particular tool in Rhino is intended to replace trimmed edge(s) with a single curve that starts and ends in the same region. I made a simple tutorial with your model showing how it’s supposed to work. I had to add another curve and join it to the existing one, giving Rhino a clear idea that I would like to replace the selected trimmed edges with the curve.

1 Like

Just to re-iterate, that’s exactly what I want to avoid! :slight_smile:

Ahh… of course! Come to think of it, I guess that’s pretty logical but I was confused by the wording of the error message. Thanks for the clarification!

(Btw, it seems that ReplaceEdge actually pulls the curves to perform it’s re-trimming by default? Wonder why it’s so difficult for trim to do the same…)

I would trim a surface or polysurface via curve only if the latter is very close to the former. Otherwise, the trimming may fail or do some crazy results. :slight_smile: Also, it’s dependent on the Z-axis orientation of the active CPlane and the camera view. Usually I prefer to extrude the curve to bot directions and use the resulting extrusion as a cutting object, because it will give me a better control.

1 Like

ReplaceEdge often works better than trim imho.
If for instance you want to round off the corner of a surface with a g2 or g3 blend curve, trimming usually does work, but seems to result in messy edges more often than not.
Splitting edges and using replaceedge with “select curve” for the corner edges usually results in a clean, single edge.

1 Like

Are they not doing the same thing, eventually?

I am sure that probably underneath ReplaceEdge and Trim there are similar if not identical algorithms at work, but the outcomes can in my experience be different nevertheless:

In my example (see my other post) rounding a corner by trimming with a blend curve often gives you a corner with non-continuous curved edge (the trimmed edge not reaching the ends of the curve, leaving two or three segments).
This doesn’t happen at all with ReplaceEdge.

As in a G0 break? Good to be aware of. Might have to try it out sometimes.

Thanks, @Rhino_Bulgaria for your movie and thanks @eobet for bringing that thread.

This is so much fun with using this. I haven`t known that command before. This is so powerful.

1 Like

I use it many times per working session, not to mention that it also could solve some weird situations where a surface edge can’t be merged due to an extremely tiny annoying lack of continuity. Literally a few minutes ago I had to use this trick to solve such an issue where the two adjacent portions of the same surface edge were unable to merge, even though I split the surface via pipe and the continuity analysis said that its edge that was magically split into two edges were G1 to each other. :slight_smile: The seam of the pipe was not interfering with the edge, so there must be some mysterious reason for that bug.

1 Like

@Rhino_Bulgaria : I would give you three “hearts” if it would be possible :slight_smile: . It`s so useful.

1 Like

Just an example:

Sorry, the screenshots got a bit compressed.
The detail in the red circle shows that the edge breaks not at the curve endpoint, but slightly further to the corner

1 Like

Even after so many years sometimes I still find new things about Rhino. :slight_smile: Also, switching from Rhino 5 to Rhino 6 and from Rhino 6 to Rhino 7 means that there are new features added to each new iteration. We all have to thank the developers who work hard to make Rhino such a great program. :slight_smile:

1 Like

Maybe it should be reported as a bug to Rhino Team.