JSCAD User Group

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. Ashish
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 5
    • Best 0
    • Controversial 0
    • Groups 0

    Ashish

    @Ashish

    0
    Reputation
    4
    Profile views
    5
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    Ashish Unfollow Follow

    Latest posts made by Ashish

    • RE: 2d line length (or perimeter)

      @gilboonet
      How do I take a dxf file and put it through this code. replacing the 'shapes' variable with "let shapes = require('./lshape.dxf')" doesnt exactly work. I believe the code is expecting cuboid

      for now I have used :
      let bounds = measurements.measureBoundingBox(contents)
      but not exactly sure what to do with the output.

      posted in General Discussions
      Ashish
      Ashish
    • RE: 2d line length (or perimeter)

      @z3dev

      Is there a sample I can look at to get access to the Paths?

      I need the paths to determine the overall length which is an input to determining the time to execute on the machine and ultimately the cost to print.

      I did come across the CSG API which has a measureArea method provided geometries. I was hoping to take the content s of a DXF file (via require('myfile.dxf')) and have it calculate the area. However the current issue is loading hte CSG module doesnt work. I put this at the top of my index.js:

      const csg = require('@jscad/csg')

      which results in
      ERROR:
      Uncaught Error: Cannot find module @jscad/csg
      Line: 38

      posted in General Discussions
      Ashish
      Ashish
    • 2d line length (or perimeter)

      I have a 2D design

      1. how do I get the line length of each point and for all lines in the object?

      For example I might have a L shape object, and inside that L, 3 small circles.

      I need to know the lenght of each side of the L, and the circumference length of all three circles.

      1. how to get the overall area of my design?

      Thanks in advance!

      posted in General Discussions
      Ashish
      Ashish
    • RE: help: Import DXF and calculate bounding box

      @z3dev thank you so much, that helped with the loading of the DXF!

      Few more questions if you don't mind.

      I've taken "contents" and want to get the bounding box for it so I can determine its size. I read there a "getBounds()" that can be used: https://openjscad.xyz/dokuwiki/doku.php?id=en:design_guide_measurements
      But contents itself doesnt have a method - ie contents.getBounds() doesnt exist. I probably don't understand the data model here I will admit.

      posted in General Discussions
      Ashish
      Ashish
    • help: Import DXF and calculate bounding box

      I'm new to JSCAD.

      Here is my use case: As a web user, I can load a DXF file so that we can automatically calculate the bounding box around the object.

      How do I do this?

      posted in General Discussions
      Ashish
      Ashish