sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    How do I find the face I just created with add_circle?

    Scheduled Pinned Locked Moved Developers' Forum
    10 Posts 4 Posters 425 Views 4 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.
    • daikuD Offline
      daiku
      last edited by

      I modified a component definition using entites.add_circle, now how do I find the disc-shaped face I just created?

      Clark Bremer
      http://www.northernlightstimberframing.com

      1 Reply Last reply Reply Quote 0
      • thomthomT Offline
        thomthom
        last edited by

        Are you maybe drawing on a face? Or using edge.find_faces afterwards?

        In any case, if you investigate one of the edges you create with .add_circle, check out it's attached faces. There might be multiple faces, but your face should be the one with the edge as part of the outer loop and have a matching normal to the circle you created.

        Thomas Thomassen β€” SketchUp Monkey & Coding addict
        List of my plugins and link to the CookieWare fund

        1 Reply Last reply Reply Quote 0
        • thomthomT Offline
          thomthom
          last edited by

          .add_circle only creates edges...

          Thomas Thomassen β€” SketchUp Monkey & Coding addict
          List of my plugins and link to the CookieWare fund

          1 Reply Last reply Reply Quote 0
          • M Offline
            MartinRinehart
            last edited by

            @daiku said:

            I modified a component definition using entites.add_circle, now how do I find the disc-shaped face I just created?

            
            a = entities.add_circle ... # a is an array of edges
            f = entities.add_face a
            
            

            Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

            1 Reply Last reply Reply Quote 0
            • thomthomT Offline
              thomthom
              last edited by

              @martinrinehart said:

              @daiku said:

              I modified a component definition using entites.add_circle, now how do I find the disc-shaped face I just created?

              
              > a = entities.add_circle ... # a is an array of edges
              > f = entities.add_face a
              > 
              

              Which of course is a much more sane version to do this than my rambling.... 😳

              Thomas Thomassen β€” SketchUp Monkey & Coding addict
              List of my plugins and link to the CookieWare fund

              1 Reply Last reply Reply Quote 0
              • daikuD Offline
                daiku
                last edited by

                Or how about this brillaint (late) insight: I used the center point of the circle to add it, so I suppose I could now look for the face that point is on (DOH!). CB.

                Clark Bremer
                http://www.northernlightstimberframing.com

                1 Reply Last reply Reply Quote 0
                • thomthomT Offline
                  thomthom
                  last edited by

                  @daiku said:

                  Or how about this brillaint (late) insight: I used the center point of the circle to add it, so I suppose I could now look for the face that point is on (DOH!). CB.

                  ? How is looking for the face that way easier than Martin's method? AFAIK there isn't a method that returns a face from a given point. You'd have to loop through lots of geometry for that.

                  Question still remains, are you drawing the circle edges ontop of an existing face?

                  Thomas Thomassen β€” SketchUp Monkey & Coding addict
                  List of my plugins and link to the CookieWare fund

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

                    Why not make all of this new geometry - both the circle's edges and its face - inside a temporary group. Then it's easy to find the face - it's the only face in the group's entities. Afterwards explode the group back to the base entities and the face stays the same 'face-entity'...

                    TIG

                    1 Reply Last reply Reply Quote 0
                    • daikuD Offline
                      daiku
                      last edited by

                      I guess Martin's way is fine. It won't create a second face, will it? Yes, I'm creating it on an exisiting face. Looping through the geometry was straightforward - it's not that large a component.

                      Clark Bremer
                      http://www.northernlightstimberframing.com

                      1 Reply Last reply Reply Quote 0
                      • thomthomT Offline
                        thomthom
                        last edited by

                        @daiku said:

                        I guess Martin's way is fine. It won't create a second face, will it? Yes, I'm creating it on an exisiting face. Looping through the geometry was straightforward - it's not that large a component.

                        In that case you should only need to check the faces collection of one of the returned edges.

                        Thomas Thomassen β€” SketchUp Monkey & Coding addict
                        List of my plugins and link to the CookieWare fund

                        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