algorithmic modeling for Rhino
Hello, I would like to create a component for grasshopper.
I woud like to create a special rectangle define by :
INPUT : two points and width.
OUTPUT : rectangle output geometry, area and normal vector of the rectangle
Here is a sketch.
I found also into rhinoscript help some script however I don't see how to manage to create such a component for a use into grasshopper.
Could you possibly help me ?
Thank you.
Marc
Pauses for user input of a rectangle.
Rhino.GetRectangle ([intMode [, arrPoint [, strPrompt1 [, strPrompt2 [, strPrompt3]]]]])
intMode |
Optional. Number. The rectangle selection mode. If not specified, all modes (0) are available. The rectangle selection modes are as follows:
|
||||||||||||
arrPoint |
Optional. Array. A 3-D base point. |
||||||||||||
strPrompt1 |
Optional. String. The first prompt or message. |
||||||||||||
strPrompt2 |
Optional. String. The second prompt or message. |
||||||||||||
strPrompt3 |
Optional. String. The third prompt or message. The third prompt used only with 3Point and Vertical modes. |
Array |
An array of four 3-D points that define the corners of the rectangle if successful. Points are returned in counter-clockwise order. See the image below for details. |
Null |
If not successful, or on error. |
Dim arrRect
arrRect = Rhino.GetRectangle
If IsArray(arrRect) Then
Rhino.AddTextDot "0", arrRect(0)
Rhino.AddTextDot "1", arrRect(1)
Rhino.AddTextDot "2", arrRect(2)
Rhino.AddTextDot "3", arrRect(3)
Tags:
Two points on the middle of two opposing edges and a with do not define a unique rectangle. Any rectangle which satisfies these constraints can be rotated around the axis defined by the two points and it will still satisfy the constraints.
Also, are you looking to do this in a Script component or do you want to create a GHA library using Visual Studio?
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Thank you David for your reply.
It will be great if I could create a user object with it.
I will try to work out with the Script component for now.
Best Regards
Hello,
Is there anychance, someone could add a plane component as an input ?
thank you for your help.
I've added a few lines in Florian's component. With z-Vector and cross product you get the y-Axis in order to define a plane. Then you can rotate around the x-Axis.
Hope that helps.
Best,
Ralf
Thank you this is great.
However I would like to input a specific plane into the plane input of this component if possible ?
thank you.
Marc
I only did the C# one.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Thank you. it 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
© 2024 Created by Scott Davidson. Powered by