JSCAD User Group

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. hrgdavor
    3. Posts
    • Profile
    • Following 2
    • Followers 1
    • Topics 20
    • Posts 151
    • Best 15
    • Controversial 0
    • Groups 0

    Posts made by hrgdavor

    • RE: fetch() in a design

      @Andreas-Plesch jscad.app is just a new prototype, not yet part of official jscad, I did not implement /remote ... it is meant for fetching remote scripts you can report issues on jscadui git or ask on discord.

      posted in Design Discussions
      hrgdavor
      hrgdavor
    • RE: fetch() in a design

      @Andreas-Plesch there is also this
      https://github.com/hrgdavor/jscadui/tree/main/apps/model-page

      I made this as an example for some users that asdek on discord and published sample here https://3d.hrg.hr/tmp/darvin/

      posted in Design Discussions
      hrgdavor
      hrgdavor
    • RE: fetch() in a design

      @Andreas-Plesch jscad.app has been just updated, and the example:

      const jscad = require('@jscad/modeling')
      const { deserializers } = require('@jscad/io')
      const { translate, scale, rotateZ } = jscad.transforms
      
      const main = async () => {
        const url = 'https://raw.githubusercontent.com/jscad/OpenJSCAD.org/master/packages/io/x3d-deserializer/tests/ElevationGrids.x3d'
        
        const response = await fetch(url)
        const cadX3D = await response.text()
        const cad = deserializers.x3d({ output: 'geometry' }, cadX3D)
      
        console.log(cad[1], jscad.geometries.geom3.isA(cad[1]))
      
        return cad[1]
      }
      
      module.exports = { main }
      

      works now

      posted in Design Discussions
      hrgdavor
      hrgdavor
    • RE: fetch() in a design

      @Andreas-Plesch jscadui project also aims to simplify for users to create their own flavor of jscad app, or demo page for their parametric creations.

      talking about it, it may be cool if jscad app reacts to drag and drop of an url .... we then create a sample script that shows how to read model from ulr and how to start manipulating it

      const jscad = require('@jscad/modeling')
      const { deserialize } = require('@jscad/io')
      const { translate, scale, rotateZ } = jscad.transforms
      
      const main = async () => {
      const object = await deserialize('https://raw.githubusercontent.com/jscad/OpenJSCAD.org/master/packages/io/x3d-deserializer/tests/ElevationGrids.x3d')
        
        // you can do some jscad operations on the loaded object and return 
        // that instead the generated return below
      
        // sample script returns the deserialized object
        return object
      }
      
      module.exports = { main }
      
      posted in Design Discussions
      hrgdavor
      hrgdavor
    • RE: fetch() in a design

      latest prototype of https://jscad.app supports async/promises main method.

      const jscad = require('@jscad/modeling')
      const { deserializers } = require('@jscad/io')
      const { translate, scale, rotateZ } = jscad.transforms
      
      const main = async () => {
        const url = 'https://raw.githubusercontent.com/jscad/OpenJSCAD.org/master/packages/io/x3d-deserializer/tests/ElevationGrids.x3d'
        
        //const url = 'https://raw.githubusercontent.com/create3000/Library/main/Tests/Components/CADGeometry/CADGeometry.x3d'
        const response = await fetch(url)
        const cadX3D = await response.text()
        // const cadX3D = x3d
        const cad = deserializers.x3d({ output: 'geometry' }, cadX3D)
      
        console.log(cad[1], jscad.geometries.geom3.isA(cad[1]))
      
        return cad[1]
      }
      
      module.exports = { main }
      

      4dd24ecb-835f-4f40-bfbf-b709735a3537-image.png

      the version that works with above mentioned code is not live yet, you can test by runing locally (untili it is):
      https://github.com/hrgdavor/jscadui/tree/main/apps/jscad-web

      IMPORTANT: jscad.app is playground for prototyping future version of openjscad web app, and is not part of of jscad officially yet, but most if not all features will make it to jscad when ready.

      posted in Design Discussions
      hrgdavor
      hrgdavor
    • RE: Interoperability with URDF / Gazebo and modelling of Robots

      @RelatingData that is openscad syntax, not jscad.

      posted in General Discussions
      hrgdavor
      hrgdavor
    • RE: AI in JSCAD for Generative AI

      @Jason-Sprouse it is an interesting idea. I am skeptical bout viability of current "AI" that is actually not AI, not even close.

      posted in General Discussions
      hrgdavor
      hrgdavor
    • RE: Starting reusing JSCAD for unfolding projects

      @gilboonet cool, combining it into single app would be awesome one day

      posted in Design Discussions
      hrgdavor
      hrgdavor
    • RE: How about a new design?

      @z3dev I periodically mention discord channel to ppl, so we could from time to time also mention this forum to users on those git tickets.

      posted in Design Discussions
      hrgdavor
      hrgdavor
    • RE: Default JSCAD script (index.js) for self-hosted website

      @z3dev that is exactly type of projects I want more jscad users to be able to do. It will likely be able to benefit from some of the resopnsiveness improvments I am making.

      posted in General Discussions
      hrgdavor
      hrgdavor
    • RE: export colored model to .obj

      @gilboonet vool 🙂 . Nice to see it working

      posted in Design Discussions
      hrgdavor
      hrgdavor
    • RE: export colored model to .obj

      @gilboonet the issue is likely that export calls generalize that then calls retessellate. these function try to fix the polygons if there are some fixable errors and also cobine multiple triangles that are coplanar into a single polygon. At that point the color info is lost as those colored triangles are replaced by a new polygon.

      posted in Design Discussions
      hrgdavor
      hrgdavor
    • RE: Designing with text

      @gilboonet I have on my list adding better support for ttf fonts, google fonts, but it will be some time until I get to it. There is also a bug in JSCAD bezier svg handling, that caused some of fonts to display differently than originally designed.

      posted in Design Discussions
      hrgdavor
      hrgdavor
    • RE: Designing with text

      @gilboonet VectorChar seems to work better, so you have a solution 🙂 Please share results of what you are aiming to create.

      posted in Design Discussions
      hrgdavor
      hrgdavor
    • RE: Designing with text

      @gilboonet taking a quick glance at the screenshot, you would not have issues with "4" if the sequence of transformations is rotation first, then translation. Using bezier is ok, but I am not sure there is anything to directly get value you need from bezier control points. But there are few bezier libs in JS that you could use to do whatever you might need.

      like https://pomax.github.io/bezierjs/

      posted in Design Discussions
      hrgdavor
      hrgdavor
    • Realtime boolean preview using GPU image based csg!!

      The bounty was successfully collected for https://github.com/hrgdavor/jscadui/issues/17

      and the result is amazing little demo of boolean preview that you see realtime spheres cutting a block with no waiting.

      https://loosetooth.github.io/scs-csg-subtraction-webgl/
      84993634-b02d-4f90-9618-d5d1fbedae38-image.png

      and the repo is
      https://github.com/Loosetooth/scs-csg-subtraction-webgl

      posted in Development Discussions
      hrgdavor
      hrgdavor
    • some more progress with prototype.

      Loading of folder projects works, it can handle ESM modules, cjs scripts (require) and even typescript projects. Also worker improvements that allow script developers to optimize execution when parameters change and cache expensive operations.

      current jscad

      https://user-images.githubusercontent.com/2480762/213881095-dcd72bce-881a-463d-a105-c9ad9c0b44bb.mp4

      my new prototype is still ugly, but things are progressing bit by bit

      It was my mission from the first attempt at making a new jscad prototype to allow script developers to optimize for performance and bling.

      in this example I took a complex model and added caching so that model is kept in case only View Options parameters change. Those only affect rotation of the parts.

      also I enhanced parameter definition to allow for live updates for any of the parameter (it is not default, but opt-in)

      https://user-images.githubusercontent.com/2480762/213881066-e947e0ae-1b80-4a06-8234-fa9b1c974a19.mp4

      posted in Development Discussions
      hrgdavor
      hrgdavor
    • RE: Default JSCAD script (index.js) for self-hosted website

      @tjw25425 if you would go in direction uding threejs this could help with faster preview
      https://github.com/gkjohnson/three-bvh-csg

      and then for export use jscad to perform the boolean operations.

      posted in General Discussions
      hrgdavor
      hrgdavor
    • RE: Default JSCAD script (index.js) for self-hosted website

      That is an interesting, but also bit complex use-case. Probably will be heavy on computation, sou you will need to do the computing in a worker. Also you need to pass graphic data for rendering back to main thread. And there is a question if you already have chosen webgl engine, or you can use current jsacad default: regl

      posted in General Discussions
      hrgdavor
      hrgdavor
    • RE: A project for rendering JSCAD in JupyterLab

      It is nice to see more users and a new enviroment. @z3dev we should think about adding a section on jscad website with links to projects like this so other users that are interested in this way of interacting with jscad can find it.

      @TerryGeng there are few of jscad fans also on discord, you may share your plugin there too. https://discord.gg/AaqGskur93

      posted in General Discussions
      hrgdavor
      hrgdavor