Grasshopper

algorithmic modeling for Rhino

# Offset direction?

Hi again,

Im having a major problem with an offset not going in the right direction.

I imagine it has something to do with the direction in which the plane this offset derives from is drawn (there are some 1200 planes)

here is the basic function and where the problem lies:

the script takes a set of planes, extracts the curve (explode) > derives the edges > joins edges to form closed curve > offset the curve (i want it inside) > planars the two and extrudes up to form a parapet

my problem is the direction of the offsets being randomly in and out of the plane.

is there a better way to do this, im thinking something along the lines of using the box to derive a plane normal to help this thing offset all the same way?

help!

thanks!

chris

Views: 35140

Attachments:

### Replies to This Discussion

The offset direction depends on the plane orientation and the direction of the curve. If the surfaces are planar you can extract a frame from the surface and use it as the offset plane for its corresponding curve. Even if the surface is reversed it will offset in the same direction because the curve direction will be reversed too.

But in case everything else fails you can always offset to both sides using a positive and negative number (it will create a new branch for every curve containing two items) and filter out the longest or shortest curve.
Hey thanks for replying,

I will give it a try but the magic might just lie in that second paragraph of yours.

i managed to put a (flat) box over each surface , determine the center point and make a plane (with Z going UP) on from that; it didnt work .. I would show what i did but rhino crashed as it was eating over 4.5GB(of 4) of memory

To extract the frame what function would I use?
Hi Chris

Vicente beat me to replying but attached code should fix the problem as Vicente has described it in his paragraph.

Also changed how the planar surfaces are created from the original and offset crv.

Just copy in attacted code and replace your code between input planes off screen and the flatten component.

Hope this helps

matt
Attachments:
cheers Matt ive given it a shot and it seems to be working!
could you post a jpeg of this definition? for some reason i can't download the latest build.

thanks!
Abigail,

GH 0.6.0059 is pinned at the top of the discussions section. See if that helps.

Going to Mike's opening on Friday?

thanks Matt. always problem solver...even back in 2010.

Lads I think I got it!

I know we all love grasshopper but I've solved this issue within Rhino.

Use the "Flip" Command on the curve and hey presto! Obviously this is also available in grasshopper but my problem was half were one way and half were the other. So it took a little while but now I have a bunch of curves behaving themselves!

Yay my first helpful Grasshopper post!!!

the flip curve in grasshopper works as well. you can add a curve to the bottom input and put it far away to make them all go in the right direction

• View All