JSCAD User Group
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Getting values from a geometry

    Scheduled Pinned Locked Moved Design Discussions
    3 Posts 2 Posters 1.3k Views 1 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.
    • gilboonetG Offline
      gilboonet
      last edited by

      Hello, I need to get sides from a geometry made of rectangles to process it line by line and apparently the sides of the rectangles are not the values, there are transforms that need to be also computed. How can I do to get the values after the transforms ? (What I want to do is sort the sides then return an unique array with for each side with as additional data its occurrence, to know if a line is a cut (1 occurrence) or a fold (2).

      z3devZ 1 Reply Last reply Reply Quote 0
      • z3devZ Offline
        z3dev @gilboonet
        last edited by

        @gilboonet geom2.toSides() should be called to obtain the sides. however, the sides are not ordered like a path. if you need ordering then a better option is calling toOutlines() which will provide each outline as a set of ordered points.

        gilboonetG 1 Reply Last reply Reply Quote 0
        • gilboonetG Offline
          gilboonet @z3dev
          last edited by

          @z3dev I finally resolved it by not using transforms and directly compute the center of the rectangles, that way the geometry sides were ok without any need to transform. I hope to be able to reuse that code for same kind of simple designs.
          Capture d’écran du 2023-03-05 10-58-47.png

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post
          Powered by NodeBB | Contributors