+ Reply to Thread
Results 1 to 4 of 4

Thread: cap extruded surface constructed from plane curve

  1. #1

    cap extruded surface constructed from plane curve

    Hi all,

    I would like to construct a solid starting from a plane curve or plane surface.
    Is there a way to do this directly (that is : avoid constructing an extrusion from
    the plane curve then trim a plane surface with the contour curve and join that
    on both ends to the extruded surface to cap it).

    I couldn't find in RhinoCommon a function to build a solid directly from a plane
    surface or plane curve. Any help would be highly appreciated.

    Thank you

  2. #2
    Senior Member Steve Baer's Avatar
    Join Date
    Apr 2010
    Location
    Seattle
    Posts
    1,464
    Blog Entries
    19
    We don't have a simple one-line function for this in RhinoCommon yet, but I did add a wishlist item for it at
    https://github.com/mcneel/rhinocommon/issues/114

    If you are working with curves on the xy plane, the following may work for you
    Python Code:
      import rhinoscriptsyntax as rs
      import scriptcontext
      import Rhino
       
      def MakeExtrusion():
          id = rs.GetObject("Select planar curve", rs.filter.curve)
          if not rs.IsCurve(id) or not rs.IsCurvePlanar(id): return
          curve = rs.coercecurve(id)
          if not curve: return
       
          extrusion = Rhino.Geometry.Extrusion()
          extrusion.SetOuterProfile(curve, True)
          a = Rhino.Geometry.Point3d.Origin
          b = a + Rhino.Geometry.Vector3d.ZAxis
          extrusion.SetPathAndUp(a,b,Rhino.Geometry.Vector3d.YAxis)
          scriptcontext.doc.Objects.AddExtrusion(extrusion)
          scriptcontext.doc.Views.Redraw()
       
       
      if __name__=="__main__":
          MakeExtrusion()

    Thanks,
    -Steve

  3. #3
    Thank you Steve for replying to my request. Your solution does what I was looking for.
    Last edited by Moha; 09-25-2012 at 02:50 PM.

  4. #4
    Super Moderator Mitch's Avatar
    Join Date
    May 2010
    Location
    Switzerland
    Posts
    286
    What about Brep.CapPlanarHoles...?

    --Mitch

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts