sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Face between two arc curve

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 3 Posters 1.2k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      hermannausowl
      last edited by

      I am looking for a way to create a face between two arc curve.

      ` model = Sketchup.active_model
      entities = model.entities
      group = entities.add_group
      entities = group.entities

      Halbkreis nach rechts / half curve to right

      center = Geom::Point3d.new 150.mm,0,0
      normal = Geom::Vector3d.new 0,0,1
      xaxis = Geom::Vector3d.new 1,0,0
      start_a = Math::PI/-2
      end_a = Math::PI/2
      edgearray = entities.add_arc center, xaxis, normal, 50.mm, start_a, end_a
      edge = edgearray[0]
      arccurve = edge.curve

      Halbkreis nach links / half curve to left

      center = Geom::Point3d.new 50.mm,0,0
      normal = Geom::Vector3d.new 0,0,1
      xaxis = Geom::Vector3d.new 0,1,0
      start_a = 0.0
      end_a = Math::PI
      edgearray = entities.add_arc center, xaxis, normal, 50.mm, start_a, end_a
      edge = edgearray[0]
      arccurve = edge.curve

      face = entities.add_face arccurve
      status = face.pushpull 20.mm`

      Thank for help. ☀

      Wir planen Ihre Büroeinrichtung mit SketchUp. http://www.momo-moebel.de

      1 Reply Last reply Reply Quote 0
      • TIGT Online
        TIG Moderator
        last edited by

        Use arccurve1 and then arccurve2 for the two curves...
        then combine them
        face=entities.add_face(arccurve1+arccurve2)
        ???
        OR
        arccurve[0].find_faces
        BUT there's no automatic references to the new face
        although it is still get-able...

        TIG

        1 Reply Last reply Reply Quote 0
        • sdmitchS Offline
          sdmitch
          last edited by

          hermann, The problem is that if you use edges or curves to add a face, they must form a closed figure which yours doesn't. What you need to do is extract and use the vertices of the two arcs to define the face. So after the first arc, add verts=arccurve.vertices. After the second arc, add verts+=arccurve.vertices. The add_face statement would then be face=entities.add_face verts.

          model = Sketchup.active_model
          entities = model.entities
          group = entities.add_group
          entities = group.entities
          
          # Halbkreis nach rechts / half curve to right
          center = Geom;;Point3d.new 150.mm,0,0
          normal = Geom;;Vector3d.new 0,0,1
          xaxis = Geom;;Vector3d.new 1,0,0
          start_a = Math;;PI/-2
          end_a = Math;;PI/2
          edgearray = entities.add_arc center, xaxis, normal, 50.mm, start_a, end_a
          edge = edgearray[0]
          arccurve = edge.curve
          verts = arccurve.vertices
          
          # Halbkreis nach links / half curve to left
          center = Geom;;Point3d.new 50.mm,0,0
          normal = Geom;;Vector3d.new 0,0,1
          xaxis = Geom;;Vector3d.new 0,1,0
          start_a = 0.0
          end_a = Math;;PI
          edgearray = entities.add_arc center, xaxis, normal, 50.mm, start_a, end_a
          edge = edgearray[0]
          arccurve = edge.curve
          verts += arccurve.vertices
          
          face = entities.add_face verts
          status = face.pushpull 20.mm
          
          
          

          Nothing is worthless, it can always be used as a bad example.

          http://sdmitch.blogspot.com/

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement