Grasshopper

algorithmic modeling for Rhino

I'm still new to coding, just playing with random geometry generation, an this is in Python.

Anyways, though probably a dumb question, how do I define an interval, to be used in defining the x,y,z dimensions of a box...

I called the box forward from the the Rhino.Geometry library because I felt that the typical Python method for creating box, defining 8 points seems like a hassle...

So, yeah... Intervals??

Thanks for anyone that may have a moment :)

Views: 831

Replies to This Discussion

new Rhino.Geometry.Interval(4.5, 8.0);

Dear David Rutten

Why in this code I have this error?

Runtime error (MissingMemberException): attribute 'Inteval' of 'namespace#' object is read-only

import rhinoscriptsyntax as rs
import Rhino

# inputs
#P = plane
# world XY plane
P0 = rs.PlaneFromFrame ( [0,0,0], [1,0,0], [0,1,0] )

Ax = 10
Ax = Ax/2
Bx = Ax * -1
print Ax
print Bx
x = Rhino.Geometry.Inteval(Ax,Bx);

#print x
Ay = 20
Ay = Ay/2
By = Ay * -1
print Ay
print By
y = Rhino.Geometry.Inteval(Ay,By);
#print y

# logic

r = rs.AddRectangle (P0,x,y)

# outputs
R = r

I think that the code you wrote was in some format error.

Attachments:

Dear Panda

I rewrite my code and is working now. Thank you.

May I ask you something else? how to add to the rectangle corner fillet radius?

I found this function Curve.CreateFillet()

but I did not realize how to use it yet.

Best!

Attachments:
Thankyou :) :)

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service