How To Extrude Closed Curve to a Line?

Hello community,

I feel still relatively new to Grashopper.
I have a cap design that I want to cut a through to achieve a shape that allows for it to interlock with a copy of itself.
This is my flawed approach so far.
I knew its possible to extrude to a point, so I started from there, but its clear to me that this will create open spaces because of the angled intersections. I’m thinking to just segment the curves on Rhino and cut through block for block; but I’m not sure I will get rid of my problem altogether and there’s probably a much more elegant solution.

upload a .gh file, so we can have a look

KappeLeiter.3dm (218.0 KB)

kappeleiter.gh (13.9 KB)

Thanks!

Your explanation made not clear what it is you are exactly want to design, but seems you want to “cut” a part of the main object. If so:

Two tips:

kappeleiterEW2.gh (25.8 KB)

Thank your for your dedication and the tips!

And apologies for being so unclear; Here is what I initially had in mind when I did it in Onshape;

This is what it looks like when I just cut straight through the part with a perpendicular profile. I remembered that on Grasshopper I’m able loft a profile to a single point and therefore thought it may be possible with a line instead of a point.

I actually already had the method of cutting everything in mind; I’m actually looking for some sort of horizontal projection that’s centered around an axis. I could perhaps construct it in Rhino manually. (but where is the fun in that plus, it would be a powerful tool for many rotated parts)

The way it is now, is that the point extrusions leave things open (particularly at the recessed section of the part-surface) similar to the onshape issue.

I guess I could approximate the intended result by sectioning of the profile into smaller chunks so that I would have an almost closed outer surface when I put the parts together. But I believe a single loft that includes the exact length of the line and somehow connects the profile horizontally could make a perfect fit.

There maybe ways of doing this with perfectly with Onshape after all. I’m still testing out its limitations as well. But I like Grasshopper and I’m happy to learn.

Welcome to the forum.

This is how you can get your cutting shape. Don’t worry about the orange component. It is just a warning. It will still work.


Extrude a Closed Curve to a Line VR 1.gh (11.5 KB)

Apologies:


Extrude a Closed Curve to a Line VR 2.gh (5.9 KB)

Thank you! I’ll check it out as soon as I get home.

The above falls apart with profiles that are not polylines, so I turned the direction of the ruled surface around.


Extrude a Closed Curve to a Line VR 3.gh (16.3 KB)

Thank you! I’ll check it out as soon as I get home.

Edit: Okay it took me a good while to figure this out but it was great fun!

For Extrude a Closed Curve to a Line VR 1.gh I find it pretty cool to just shrink the projection to down to 0 on the one (x) dimension with the ScaleNU component! I still don’t get why the corner points of the projection changed their z-value though:

Extrude a Closed Curve to a Line VR 2.gh is a bit more like magic to me, particularly this part

I only understand what happens in a general sense here, but next time I’ll try to figure out data matching before I do anything else.

In any case, thanks a lot; it works now :slight_smile:

Here’s the file, for whoever’s interested:

kappeleiter2.gh (33.0 KB)

I’ll try it too.

kappeleiter2 a.gh (62.1 KB)

Actually, I am now reminded of this.

When you horizontally scale the profile to a line, the horizontal segments become segments of zero length. Grasshopper recognizes these segments as invalid, and rebuilds the profile without them. Out of a profile of formerly 6 sides, you get a closed loop of 3 vertical colinear lines and attempting to create a loft or a ruled surface between the profiles expresses this mismatch.

In my second solution, I attempted to circumvent disappearing profile segments by creating lines between the discontinuities of the original profiles and their translation to over the origin ({0,0,x.z}); then spanning between the them with ruled surfaces. Yes, the section of that script that baffles you is just data manipulation that pairs consecutive lines around the figure into branches so that they can be appropriately fed into Ruled Surface.

The problem with this is that it only works with polygnal profiles,:

firstly, because the onset of the fillet in the profile is not a discontinuity, and, secondly, because this method does not allow for any curved surfaces.

The third and final solution is akin to the first, only that I am directly defining the translation of individual segments of the original profile as lines over the origin. The problem of horizontal segments translating to points still exists, but unlike when they are part of a larger curve, they get interpreted as a point instead of getting blinked out of existance. This is the solution I suggest you use.

You can also just not project your profiles to a line. This is the approach that @leopoldomonzani has taken, but can be more simply expressed thusly:


Extrude a Closed Curve to a Line VR 4.gh (16.3 KB)

where the compound transformation being used is a mirror across the XZ and the YZ planes (order insignificant).

Interestingly, if you set the tween to 0.5 (that is when tween is a line over the origin) a single untrimmed surface can be successfully created! But the surface is wierd – Grasshopper refuses to create a closed surface from it by capping because the “open” end which is the line above the origin is self intersecting.

This is so much fun!

much simpler; Still, I hope I can look back at the previous version with a little more clarity some time. Thanks for sharing the process! kappeleiter3.gh (36.4 KB)

@leopoldomonzani I didn’t expect this to become so multi faceted; looking forward to a steep learning curve.

And again, I guess have to chew on it for a bit…

To everyone, thanks for the warm welcome!
This has left me a lot to tinker with. Also with the mirror process in particular. I was actually wondering for a minute how to go about mirroring it. But I guess was a little too focused on the results; Which i’d say, turned out great with very little to tweak; I even got lucky on the PLA clearance I didn’t account for.

Honestly, we would have been better served with the whole geometry and just the splitting profile. I’ve recreated that outset circumstance here:

From here, you can get to the split form in relatively few steps:


Extrude a Closed Curve to a Line VR 5.gh (67.9 KB)

  • Extend the profile curve by an arbitrary amount past the height of the ring.
  • Fillet to make the interlocking of the two halves prettier
  • Rotate the profile 180 degrees around the ring
  • Ruled surface between the two profiles
  • Thicken the created surface by the gap width to a solid
  • Boolean difference the ring with the gap solid

The only problem is the unecessary splitting of the inside flange…

In a way I have to ask why parameterizing this is even necessary. You’d be much more quickly finished just doing this in Rhino.

:face_with_raised_eyebrow:

Yeah sorry about that, it makes sense; I didn’t think I was smart enough to do that. I guess I’ll have to file it under experience.

One of the reasons was that I started to do this in Onshape and when I got stuck, remembered that I lofted some more acrobatic stuff on Grasshopper once; That’s when I tried.

I also noticed I could have used that similar trick of scaling to a line by just creating a .1 rectangle instead of an axis.. And since I’m not the best designer I’m trusting consensus opinion to go with the round corners. :+1:

I now think, one might be able to loft a line and a profile on Onshape too, provided that geometries are selected in the right order, but I haven’t managed to do it yet.

That’s less an opinion on aesthetic than a functional consideration. It is easier to put together that way.

Before you even get around to splitting the main body, you should probably parametericise it:
Extrude a Closed Curve to a Line VR 6.gh (45.8 KB)

Another inbetween stage:

Extrude a Closed Curve to a Line VR 7.gh (66.0 KB)