algorithmic modeling for Rhino
Anyone know how to construct a horizontal frame?
I am trying to offset boundary curves from a planar brep internally to create a shelled region, but I can't figure out how to create a direction that will always go into the shape. Taking the boundary curves from the planar brep, the outside curve goes clockwise and the inner curves go anticlockwise, but if I create a frame at any point on the curve the y-axis are always pointing in the same direction:
Whereas if I use a horizontal frame in grasshopper:
There doesn't seem to be a method for making a horizontal frame in rhinocommon (or not that I've found), and I was wondering if anyone had any insight into how it is constructed?
Tags:
Horizontal frame is probably normal to the world Z axis, whereas the curve frame gets its normal some other way. One bare bones way you could reproduce horizontal frame would look like the following (C#, sorry if that's not your preferred flavor):
Plane horizFrame(Curve C, double t){
Vector3d Tangent = C.TangentAt(t);
Vector3d Perp = Vector3d.CrossProduct(Vector3d.ZAxis, Tangent);
Plane frame = new Plane(C.PointAt(t), Tangent, Perp);
return frame;
}
This assumes that your curves are all already parallel to the XY plane, otherwise you'll have to project the tangent vector to XY (or set its z component = 0) before the cross product.
Thanks Andrew! I was actually trying to do that method, but I didn't have the cross product of the z axis and tangent part.
Thanks again. Works great.
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
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by