Does someone have code or a formula for determining the slope of a surface using Python in Rhino? The surfaces 3 and 4 point surfaces that are planar.
Find the lowest and highest corner points and then measure the line between them.
Could do midpoints between corners if there was a orientation that slope was measured in.
Hi Mike - I guess it might not always be clear what line you care about, depending on the surface orientation - do you have an example?
There is DimCreaseAngle
in plain Rhino too. Use this with your plane and a horizontal one.
Here’s a thing I found in the pile and tuned up - see how that goes.
SrfSlope.py (3.8 KB)
It’s surface angle really, not slope - it could be slope…
-Pascal
For an arbitrary planar surface, I might project a small circle onto the surface (or its plane if all you need is a vector), get the world-oriented bounding box, intersect the bounding box with the projected circle and connect the two intersection points - that should be your slope line/vector.
Hi, I think I would try taking the surface normal and getting the angle from vertical / from horizontal.
Another option …
Here is the script that I’ve been using for exactly that purpose.
c5-planarslope.py (2.2 KB)
You can pick a (planar) surface or a (linear) curve.
Just hit Enter to get rid of the text dot after using the script.
@Dancergraham - Hey Graham… I moved forward with your suggestion. Here’s the code if you are interested…
GetSurfaceSlopeAndAngle.py (1.6 KB)