Simple 2d parametric design



  • Hello, is it possible to use JSCAD to make a parametric 2d design ? I made a basic frame pattern from a 20x20x5 3d model, and unfolded its pattern that is made of 4x the same piece. I figured that this pattern can be used to make frames of any length only by changing the distance between the top and the bottom. Do you have hints to do such design ? Could I make it with 2 different kinds of line (the solid red is for cuts and the dotted maroon is for mountain folds) ?

    Capture d’écran de 2021-06-23 11-07-11.png



  • @z3dev Thanks a lot, it is always helpful to understand the reason of specific behaviors. My design has one path for the outline that will be cut, and lines for the folds. To remove the black fill I can try to turn the path to a polygon.



  • @gilboonet nice progress!

    A few pointers on colors…

    • paths (path2) are exported with a stroke color
    • 2D geometry (geom2) are exported with a fill color

    There are default colors set, which follow the SVG specifications.

    https://www.w3.org/TR/SVG2/painting.html#SpecifyingFillPaint

    So, if you really want stroke colors then your design should return paths.

    Hope,that helps.



  • Hello, I now made the parametric version, here. The only parameter is width (largeur) that is the outer width of the frame obtained when 4 pieces are assembled together. I needed to juggle with cm and inches to make it right.

    Here is a screenshot of what I have. When I view the generated svg into my browser (Firefox, bottom right), I have red and blue lines, even if there is a black fill that is certainly default because I didn't use black on the jscad script.
    The other screenshot if from my laptop on win10 that I need to use my blade cutter software. I imported the svg and was able to prepare it for cut.
    The only drawback for the moment is that the svg imported on Inkscape (top right of first screenshot) loses the red and blue lines, but editing the svg won't be needed for such a simple design.

    Capture d’écran de 2021-06-26 15-26-05.png
    Capture d’écran 2021-06-26 153319.png



  • @hrgdavor Thank you for your reply. I'm giving it a try.
    Capture d’écran de 2021-06-25 11-26-29.png
    On top left the svg that my unfolder generated
    On bottom left the svg generated by JSCAD, I needed to edit it by hand to add colors. I think the parametric part won't be hard, I just need to translate the second path (poly2). I'm still need to know what unit is used (I suspect it is inches) because the final scale is not the same as the original one.



  • it shoud be no problem, as you can generate 2d as well as 3d shapes.

    You could have different colors, but I think right now, you have no option for line type.


Log in to reply