JSCAD User Group

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. Popular
    Log in to post
    • All categories
    • All Topics
    • New Topics
    • Watched Topics
    • Unreplied Topics
    • All Time
    • Day
    • Week
    • Month
    • gilboonet

      Unfolder V2, stress test on FF and Chrome
      Comments & Feedback • • gilboonet

      10
      0
      Votes
      10
      Posts
      1985
      Views

      hrgdavor

      @gilboonet that is excellent, it may be possible later on to integrate that one with jscad or at least take your experience for ideas how to improve 2D use-cases in jscad.

    • ajw1970

      Using JSCAD to build meshes for BabylonJS
      Design Discussions • • ajw1970

      10
      0
      Votes
      10
      Posts
      1308
      Views

      z3dev

      @ajw1970 super!

      I'm interested in the final application. Why did you want to use Babylon for rendering? And do you further plans to create some online designs?

    • Hermann-SW

      JSCAD for planar graph embeddings onto (unit) sphere
      Design Discussions • • Hermann-SW

      10
      0
      Votes
      10
      Posts
      1388
      Views

      Hermann-SW

      I implemented optional JSCAD output for planar graph playground "node.tetra.js", details here:
      https://forums.raspberrypi.com/viewtopic.php?p=2030546#p2030546

      Until now I played with C20 hand edited for JSCAD, this is newly created C60 fullerene with 60 vertices and 90 edges:
      https://www.openjscad.xyz/?uri=https://stamm-wilbrandt.de/en/forum/JSCAD.C60_vtype.js

      More vertices and edges than for C20, but design regeneration still done in less than 10 seconds on Intel it Linux Chrome!
      https://forums.raspberrypi.com/download/file.php?id=56198

    • hg42

      V2 status and testing environments
      Development Discussions • • hg42

      9
      0
      Votes
      9
      Posts
      1388
      Views

      z3dev

      @hg42 you might be able to use the regl-renderer module directly. there's a couple of demo applications, which could be tweeked to reload a design.

    • gilboonet

      V2 Feedback : converting V1 examples
      Development Discussions • • gilboonet

      9
      0
      Votes
      9
      Posts
      601
      Views

      gilboonet

      Eighth example, lookup :
      Capture d’écran de 2020-08-30 16-16-04.png
      It looks ok, but my lookup function is maybe buggy, I needed to stretch return value (x2) to have same lengths as V1, and to add a center to each cylinders to make it look the same.

      // title : Lookup // author : OpenSCAD.org, adapted by Rene K. Mueller // description: testing lookup() function // file : lookup.jscad // from http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Mathematical_Functions const jscad = require('@jscad/modeling') const { primitives, transforms, colors, maths } = jscad const { cylinder } = primitives const { translate } = transforms const { colorize, hslToRgb } = colors const { vec2 } = maths const { lerp } = vec2 function getCylinderH (p) { return lookup(p, [ [ -200, 5 ], [ -50, 20 ], [ -20, 18 ], [ +80, 25 ], [ +150, 2 ] ]); } function main () { var w = []; for (var i = -100; i <= 100; i += 5) { w.push(colorize(hslToRgb([((i + 100) / 200) * 0.3 + 0.6, 1, 0.5]), translate([i, 0, -30], cylinder({radius: 4, height: getCylinderH(i) * 3 *2, segments: 16 , center : [i,0,getCylinderH(i) * 3] })))); } return w; } function lookup(ix, L){ // L = [ [ i0, v0], ..., [iN, vN] ] if (ix <= L[0][0]) return L[0][0]; var i = L.length-1; if (ix >= L[i][0]) return L[i][0]; i = L.findIndex( x => x[0] >= ix); v1 = L[i-1][1]; v2 = L[i][1]; if (ix === L[i-1][0]) return v1; if (ix === L[i][0]) return v2; var i1 = L[i-1][0], i2 = L[i][0]; var r = v1 + (v2-v1) / (i2-i1) * (ix-i1); return r; } module.exports = { main }
    • BarbourSmith

      Generating project thumbnails
      General Discussions • • BarbourSmith

      9
      0
      Votes
      9
      Posts
      826
      Views

      gilboonet

      @gilboonet It works. I needed to specify ... while pushing content into the return variable. I still need to stop the animation so my video capture will perfectly loop. And there's something that I didn't manage to do, it's creating a new project, for the moment I'm changing demo-web.js, otherwise there is an error (cannot find myAnim.js when I try to run npù run myAnim.js)
      text alternatif

    • gilboonet

      Error when saving 2d rendering
      General Discussions • • gilboonet

      9
      0
      Votes
      9
      Posts
      655
      Views

      gilboonet

      @z3dev Thanks a lot for your suggestions, I will try to implement them. I have some marginal cases where it will certainly help to have exact vertices

    • Ion

      2D slice from extruded polygon after substraction
      Development Discussions • • Ion

      9
      0
      Votes
      9
      Posts
      1016
      Views

      gilboonet

      @Ion-0 That's great !

    • T

      As jscad.xyz is down, where to get more doc?
      General Discussions • • tubaro1

      9
      0
      Votes
      9
      Posts
      1495
      Views

      danmarshall

      @z3dev thank you, that is really helpful!

    • gilboonet

      basic design for projection
      Design Discussions • • gilboonet

      9
      0
      Votes
      9
      Posts
      1062
      Views

      z3dev

      @gilboonet excellent!

      You are the super user!

    • gilboonet

      V2 feedback
      Development Discussions • • gilboonet

      9
      0
      Votes
      9
      Posts
      1162
      Views

      gilboonet

      @hrgdavor Thank you, that's very nice. It's not that I like folding things but it's a process I use to build them with cardboard

    • gilboonet

      V2 Unfolder complete, multipage pdf creation from its 2d output
      Design Discussions • • gilboonet

      9
      1
      Votes
      9
      Posts
      848
      Views

      hrgdavor

      @gilboonet that is definitely something worth considering either as part of jscad or an addon library. I think we will have better idea after I have some time to cooperate with you on your project. It is definitely an interesting use-case, and a real project will give much needed insight on how to proceed with it.

    • samuelwang48

      an ios app that embeds jscad
      General Discussions • • samuelwang48

      9
      3
      Votes
      9
      Posts
      1016
      Views

      samuelwang48

      @z3dev hi, yes, it can be found in Apple App Store if you search for "Rukkou". Or use this link directly on a Mac OS. Do let me know your feedbacks 🙂

    • udif

      Dynamically updating the parameter array returned by getParameterDefinitions() ?
      General Discussions • • udif

      9
      0
      Votes
      9
      Posts
      1129
      Views

      Antoine Guillaume

      @hrgdavor for the moment i have create only one field and i serialize all datas of form and i check the values in the openjscad script

    • hpb-htw

      Using JScad just to display 3D-Object
      General Discussions • • hpb-htw

      9
      0
      Votes
      9
      Posts
      449
      Views

      z3dev

      @hpb-htw Nice! You might be the first person using V3.

      So, V3 is currently in Alpha release. Or course, V3 is in the same GIT repository but on the V3 branch. So, you can get all the packages by checking out the branch.

      git checkout V3

      Again, take a look at the demos in regl-rendering

    • gilboonet

      V2 Feedback : script hangs
      Development Discussions • • gilboonet

      8
      0
      Votes
      8
      Posts
      568
      Views

      gilboonet

      @z3dev You're right, the problem was about winding and by correcting it for MeasureArea() < 0 and triangulating was enough to make it work. I updated my source here : https://github.com/gilboonet/gilboonet.github.io/blob/master/demos/gigi.js It contains a volume exported from Wings3d, with Cube1_default() that contains data with quads and table() with this :

      function table() { var a = Cube1_default(); var tmp = []; for(var i = 0; i < a.polygons.length; i++){ if (measureArea(a.polygons[i]) < 0){ a.polygons[i] = a.polygons[i].reverse(); } for(var j = 1; j< a.polygons[i].length-1; j++){ tmp.push([a.polygons[i][0], a.polygons[i][j], a.polygons[i][j+1]]); } } return scale([8,8,8], polyhedron({points:a.points, faces:tmp})); }

      There is certainly a way to write this code a more modern way with map() to speed it up.

    • gilboonet

      About polygons winding
      Development Discussions • • gilboonet

      8
      0
      Votes
      8
      Posts
      551
      Views

      gilboonet

      I'm trying now csg on a .obj file imported (require) into V2. It works fine with an intersect, but when I try to make lots of intersect, the return statement has errors.
      Capture d’écran de 2020-09-16 10-22-07.png
      On my example, height is 104 units, I can return a slice every 3 units, but when I try to return a slice every 2 units (and my real process needs smaller slices) it bugs :

      elapse for solid generation: 39 design.js
      total time for design regeneration 7015 17 design.js
      Uncaught (in promise) TypeError: a is undefined (2 times)

    • Alasdair McAndrew

      Issues on Linux - designs not rendering in html viewers
      General Discussions • • Alasdair McAndrew

      8
      0
      Votes
      8
      Posts
      711
      Views

      z3dev

      @Alasdair-McAndrew sure.

      check out the recent post by @crysislinux

      i haven't seen anyone embed V2 into a web page yet, but that will happen soon.

    • jess yan

      Use jscad in vue
      Development Discussions • • jess yan

      8
      0
      Votes
      8
      Posts
      810
      Views

      z3dev

      @jess-yan Super! Please let us know when a working website is available. There are many of us that want to extend JSCAD in various ways.

    • gilboonet

      import/export of .obj file
      Development Discussions • • gilboonet

      8
      0
      Votes
      8
      Posts
      1152
      Views

      gilboonet

      @platypii Thank you for this investigation. I remember that I tried to get JSCAD to union those groups but then it loses colors. I use Wings 3d to colorize my models, and it does not split them into separate objects (on my screenshot I have only one geometry), only materials are separated into groups.
      Capture d’écran du 2022-06-14 10-11-33.png

      Capture d’écran du 2022-06-14 10-29-42.png

      I splitted the model into 3 geometries and then exported it to .obj and the difference is that it contains 3 lines starting with "o " that defines start of an object. Maybe for the moment JSCAD translate lines starting with "g " like "o ".