algorithmic modeling for Rhino
Tags:
Dim pt As Point3d = GetPointFromSomewhere()
If (pt Is Nothing) Then Return
Dim i As Integer
Dim d As Double
Dim d As Double = Double.NaN
Dim ln As Line = GetLineFromSomewhere()
Dim pt As Point3d = GetPointFromSomewhereElse()
Dim pp As Point3d = ln.ClosestPointTo(pt, False)
Dim ln As Line = GetLineFromSomewhere()
If (Not ln.IsValid) Then Return
Dim pt As Point3d = GetPointFromSomewhereElse()
If (Not pt.IsValid) Then Return
Dim pp As Point3d = ln.ClosestPointTo(pt, False)
If (Not pp.IsValid) Then Return
Dim pt As Point3d = Point3d.Unset
Dim cr As Circle = Circle.Unset
Public Sub LimitPoint(ByVal pt As Point3d, ByVal box As BoundingBox)
pt.X = Math.Max(pt.X, box.Min.X)
pt.X = Math.Min(pt.X, box.Max.X)
pt.Y = Math.Max(pt.Y, box.Min.Y)
pt.Y = Math.Min(pt.Y, box.Max.Y)
pt.Z = Math.Max(pt.Z, box.Min.Z)
pt.Z = Math.Min(pt.Z, box.Max.Z)
End Sub
Public Sub LimitPoint(ByRef pt As Point3d, ByVal box As BoundingBox)
pt.X = Math.Max(pt.X, box.Min.X)
pt.X = Math.Min(pt.X, box.Max.X)
pt.Y = Math.Max(pt.Y, box.Min.Y)
pt.Y = Math.Min(pt.Y, box.Max.Y)
pt.Z = Math.Max(pt.Z, box.Min.Z)
pt.Z = Math.Min(pt.Z, box.Max.Z)
End Sub
Public Function LimitPoint(ByVal pt As Point3d, ByVal box As BoundingBox) As Point3d
pt.X = Math.Max(pt.X, box.Min.X)
pt.X = Math.Min(pt.X, box.Max.X)
pt.Y = Math.Max(pt.Y, box.Min.Y)
pt.Y = Math.Min(pt.Y, box.Max.Y)
pt.Z = Math.Max(pt.Z, box.Min.Z)
pt.Z = Math.Min(pt.Z, box.Max.Z)
Return pt
End Function
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