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

    Making a face

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 160 Views 2 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.
    • A Offline
      Alucinor
      last edited by

      I'm trying to make a half circle and then pushpull it into a half cylinder.

      The way I went about it was making an arccurve and then putting a line at the base of this curve. However reading through the the api it seems like it isn't possible to make a face from a curve and an edge. Is this the case? If so, what would you recommend for making a half cylinder?

      @unknownuser said:

      Entities.add_faceSketchUp 6.0+

      The add_face method is used to create a face. You can call this method a number of ways:
      
          entities.add_face(edge1, edge2, edge3, ...)
          entities.add_face(edgearray)
          entities.add_face(pt1, pt2, pt3, ...)
          entities.add_face([pt1, pt2, pt3,...])
          entities.add_face(curve)
      
      
      
      For the last form that takes a Curve, the curve must be closed - like a circle.
      
      Arguments:
      
      some_entities
          Either a series of Edge or Point3d objects, an array of Point3d objects, or a closed Curve.
      
      Returns:
      
      face
          a Face object if successful
      
      depth = 100
      >      width = 100
      >      model = Sketchup.active_model
      >      entities = model.active_entities
      >      pts = []
      >      pts[0] = [0, 0, 0]
      >      pts[1] = [width, 0, 0]
      >      pts[2] = [width, depth, 0]
      >      pts[3] = [0, depth, 0]
      >      # Add the face to the entities in the model
      >      face = entities.add_face pts
      >      if (face)
      >        UI.messagebox face
      >      else
      >        UI.messagebox "Failure"
      >      end
      
      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        Make the Arc.
        It returns an array of its Edges.
        edges=entities.add_arc(...)
        You then have several ways of adding a Face from those...
        For example make an array of the vertices and use those...
        verts=[] edges.each{|e|verts << e.vertices} verts.flatten.uniq!
        Then use
        entities.add_face(verts)
        There are also other ways, for example add the missing edge
        ed=entities.add_line(edges[0].curve.first_edge.start.position, edges[0].curve.last_edge.end.position) edges << ed
        Then use
        entities.add_face(edges)
        ...............
        etc...

        TIG

        1 Reply Last reply Reply Quote 0
        • A Offline
          Alucinor
          last edited by

          Thanks a bunch TIG, I forgot you could get the arcs edges! Still organizing all this information

          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