algorithmic modeling for Rhino
Hello All,
We are strategizing how to come up with a definition we can use to affect a grid with an attractor curve. However we only want to affect one side of the curve and not the other. The question we would like to ask is are there any components you (the community) might suggest to help us out. We have tried googling it for tips but to no success. Any tips out there?
Tags:
The standard approach is to find out for each point in the grid whether it is to the left or the right of the line. There are several ways to do this:
Another solution would be to use a rectangle instead of a line, in which case you can test for rectangle inclusion. The rectangle simply needs to be big enough to encompass all points to the left of the boundary.
--
David Rutten
david@mcneel.com
Let P be the test point and Pc the point on the Curve closest to P
Now let's define two vectors:
A = P ->Pc
B = tangent to Curve at Pc
IF you take the cross product of these two (A x B), you'll get a vector C, which you can decompose on the plane of the drawing (I'm assuming it's a planar case) test the Z coordinate:
- if positive - P lies on one side of the curve
- if negative - P lies on the other side of the curve
I just added a component which automates this (no icon yet):
Inputs are:
Outputs are:
The outputs are slightly superfluous, but this makes it easier to use the answer in whatever way you want.
--
David Rutten
david@mcneel.com
WOw
Idk why my message was not fully posted, but can we download this component somewhere or can we expect it in a future release? Also, thank you to Jacek and David for your help and great work.
It will be available in the next release. Until then you'll have to use the workaround I posted higher up.
--
David Rutten
david@mcneel.com
I am interested how it would work with multiple curves. My partner and I came up with a very inefficient way of doing it manually. The problem is that it is losing the parametric relationship that it should have.
You'd generate one left/right boolean for each point/curve combination, then you have to somehow combine these booleans. You can either use logic gate components for this such as OR and AND, or you can treat the booleans as integers and use Mass Addition.
--
David Rutten
david@mcneel.com
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by