JSCAD User Group

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Getting values from a geometry

    Design Discussions
    2
    3
    454
    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.
    • gilboonet
      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).

      z3dev 1 Reply Last reply Reply Quote 0
      • gilboonet
        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
        • z3dev
          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.

          gilboonet 1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB | Contributors