Skip to content

Commit

Permalink
Fixes RH-58309 adds SampleDraftAngleCurves.py
Browse files Browse the repository at this point in the history
  • Loading branch information
travisserio committed May 5, 2020
1 parent 4e3c9b6 commit 60176aa
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 3 deletions.
43 changes: 43 additions & 0 deletions rhinopython/SampleDraftAngleCurves.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
################################################################################
# SampleDraftAngleCurves.py
# Copyright (c) 2020 Robert McNeel & Associates.
# See License.md in the root of this repository for details.
################################################################################
import Rhino
import scriptcontext



def SampleDraftAngleCurves():

sphere = Rhino.Geometry.Sphere(Rhino.Geometry.Point3d.Origin,10)
brep = sphere.ToBrep()

direction = Rhino.Geometry.Vector3d.ZAxis * -1

min_radian = Rhino.RhinoMath.ToRadians(-15)
max_radian = Rhino.RhinoMath.ToRadians(15)

tolerance = scriptcontext.doc.ActiveDoc.ModelAbsoluteTolerance
angle_tolerance = scriptcontext.doc.ActiveDoc.ModelAngleToleranceRadians

min_draft_silhouettes = Rhino.Geometry.Silhouette.ComputeDraftCurve(brep,min_radian,direction,tolerance,angle_tolerance)

for s in min_draft_silhouettes:
scriptcontext.doc.ActiveDoc.Objects.Add(s.Curve)

max_draft_silhouettes = Rhino.Geometry.Silhouette.ComputeDraftCurve(brep,max_radian,direction,tolerance,angle_tolerance)

for s in max_draft_silhouettes:
scriptcontext.doc.ActiveDoc.Objects.Add(s.Curve)

scriptcontext.doc.ActiveDoc.Objects.AddSphere(sphere)
scriptcontext.doc.ActiveDoc.Views.Redraw()

return Rhino.Commands.Result.Success

# Check to see if this file is being executed as the "main" python
# script instead of being used as a module by some other python script
# This allows us to use the module which ever way we want.
if( __name__ == '__main__' ):
SampleDraftAngleCurves()
4 changes: 1 addition & 3 deletions rhinopython/SampleRibbonOffsetCurve.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
# Copyright (c) 2020 Robert McNeel & Associates.
# See License.md in the root of this repository for details.
################################################################################
import clr
import Rhino
import scriptcontext
import System.Drawing.Color
import System.Collections.Generic.IEnumerable as IEnumerable


def SampleCreateRibbon():

Expand Down

0 comments on commit 60176aa

Please sign in to comment.