Shrink Surface analogue to ExtendSrf in Rhino

Hi, it seems that the Surface.Extend method is very different from the ExtendSrf command in Rhino.

I want to shrink a surface on one side/edge with negative length inputs just like the ExtendSrf command, is there a way to do this with the rhinocommon?

int iKante = 0;
            IsoStatus gKante = IsoStatus.West;
            double iLaenge = 5;
            bool iSmooth = true;
            //Interval iInterval = new Interval();
            //int iDirection = 0;

            Surface oExtrapolation = null;

            DA.GetData("Fläche", ref oExtrapolation);
            DA.GetData("Kante", ref iKante);
            DA.GetData("Länge", ref iLaenge);
            DA.GetData("Smooth", ref iSmooth);

            if (iKante == 0)
            {
                gKante = IsoStatus.East;
            }
            if (iKante == 1)
            {
                gKante = IsoStatus.West;
            }
            if (iKante == 2)
            {
                gKante = IsoStatus.South;
            }
            if (iKante == 3)
            {
                gKante = IsoStatus.North;
            }

            DA.SetData("Extrapolation", oExtrapolation.Extend(gKante, iLaenge, iSmooth));

ps. i don’t know how to use the flagged enums in a prettier way

I have tried out some different approaches to do this, but they all change the original surface too much…


the surfaces stacked in the middle are the original, one made with rhino ExtendSrf and one made with the RhinoCommon Surface.Extend() Method

The three to the sides are my approaches. I mainly tried to take the control points and make NURBS-curves from them to extend them with the ExtendCurve. I think the best surface came from taking the wireframe of the surface and use the isocurves with extend, but it’s still different from the original surface.

extend_shrinkSrf.3dm (717.6 KB)
extend_shrinkSrf.gh (20.5 KB)



I don’t think Surface.Extend handles negative values and work like “shrink”

For enum problem:

    E = S.Extend((IsoStatus) Edge, Length, Smooth);

Not all commands can be found in Rhinocommon SDK.
They might include the same keyword (extend here).
But it is totally common that commands in Rhino uses different core as Rhinocommon ones.

Your GH file is missing your plugin.

for your 2nd question
what are you trying to do?

The first question is “negative extend” and what does the 2nd GH file do,
Do you want to extend this patch srf or “negative extend/shrink” it?


1: untrim and use surface.extend
2: from your GH file, you can use extend curve, but it has to be the right override, and also pay attention to the degree, your patch is 3 degree.
ext.gh (9.3 KB)

Hi,

I have a custom component that does the following thing under the hood :

  • untrim the surface
  • offset the edge on the surface and extend it
  • split the surface

All of these steps can be done with native components and seem to give the intended result here.

Why are you doing a Patch since you have exactly four edges ? Edge Surface would give a cleaner result.

extend_shrinkSrf.gh (28.0 KB)

I think he wants to extend the surface beyond the “untrimed” one. from his Rhino file.
Still not sure.

Hi,

first of all thank you and sorry for the late response.
The goal here is to do literally the same thing as the Rhino ExtendSrf command, I am relatively satisfied with what the Surface.Extend() method does, but I want to make a plugin that does the same as the negative input part of ExtendSrf.
From what I have observed this command does the following with positive inputs:

  • choose a subsurface edge and move it on top of the NURBS Surface
  • if you move the trimmed edge outside of the NURBS Surface, it will automatically use the Extend() method to keep the Trim on the surface

Generally the RhinoCommon Method of Extend does the same thing as ExtendSrf just without trimming

for negative inputs:

  • choose a subsurface edge and move it on top of the NURBS Surface
  • moving it to “shrink” will compress the affected IsoStatus direction without changing the NURBS surface geometry in a meaningful way

I think this compression happens through some kind shrinkFace method, not too sure though.

I just checked magicteddy’s component, it does shrink the subsurface, but I really want to compress the NURBS surface under it too.

E: I think your approach is really close to what I was looking for. It never occured to me that there was a CP Loft component.
I will try to program a gha out of this next monday and come back to this
ext2.gh (14.5 KB)

There is a Shrink method in RC - equivalent to Rhino’s ShrinkTrimmedSrf command.
If you want to have an untrimmed surface at the end, you’ll have to split by isocurve instead of an offset. So you’ll lose the ability to define a precise length.

Pufferfish plugin also has a Shrink component.

1 Like

“Shrink” in rhino has its specific definition
not the way you think it is.

to actually make the surface smaller, you will have to trim the surface (mostly with iso curve)

here is some shrink code:


shrink.gh (6.8 KB)

I just call it shrink, because the official documentation for Rhino 7 calls this negative input “shrink”

But I still think, that they used some kind of combination of subsurface trim and shrink to create a smaller surface, I will try to come up with something on monday.

Sooo, I am still working on the VS implementation.
Both solutions in this are pretty good at manipulating the NURBS-Surface, the only difference, is that the first one builds a complete new surface from the same information and the second one uses the shrink function to approximate the subsurface changes.

extend_shrinkSrf.gh (36.0 KB)
extend_shrinkSrf.3dm (286.2 KB)

But from what I can see the shirnking method is the same as the one they use for the rhino command ExtendSrf.

I wrote the both functions into a gha (the shrinking one without the trim section, since I dont really need that)
Shrink.gha (8.5 KB)

I am pretty satisified with the results :grinning: