JSCAD User Group

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

    Display Code

    Development Discussions
    3
    6
    581
    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.
    • BarbourSmith
      BarbourSmith last edited by

      Can anyone point me to the part of the code which is doing the conversion from CSG geometry to threejs geometry for display? I'd like to mess around with it, but I'm a little unsure where to look. Thanks!

      z3dev 1 Reply Last reply Reply Quote 0
      • z3dev
        z3dev @BarbourSmith last edited by

        @BarbourSmith is there some reason to use three.js? the primary focus of three.js is quite differnet from JSCAD.

        It should be pretty trivial to convert between three.js data structures and JSCAD data structures. But don't expect either project to supply the conversions.

        Maybe somone has a set of functions already, or you'll have to write some simple conversion functions.

        1 Reply Last reply Reply Quote 0
        • gilboonet
          gilboonet @BarbourSmith last edited by

          @BarbourSmith If your jscad geometry is a polyhedron, you can use : https://threejs.org/docs/#api/en/geometries/PolyhedronGeometry

          1 Reply Last reply Reply Quote 0
          • BarbourSmith
            BarbourSmith @z3dev last edited by

            @z3dev Thank you!

            I think I didn't really understand enough to ask the right question. Thanks for getting me closer. I think what I meant to ask is, "Is there an existing way to display threejs geometry in three.js?"

            I looked in utils, this jscad github issue seems like the closet thing I could find.

            Am I barking up the wrong tree? If I want to display jscad geometry in a browser is three.js the wrong approach?

            gilboonet z3dev 2 Replies Last reply Reply Quote 0
            • BarbourSmith
              BarbourSmith last edited by

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • z3dev
                z3dev @BarbourSmith last edited by

                @BarbourSmith 🙂

                I'm assuming that you are interested in the V2 version. Here's a short summary.

                The 'packages' directory contains the source code for each of the packages.

                • cli contains the command line application
                • core contains various things for converting, handling events, etc. (used by all apps)
                • desktop contains the standalone application (still not V2)
                • examples
                • io contains the import/export of external formats
                • modeling contains the CSG engine, etc.
                • ui (un-used now)
                • utils contains small components. one is the regl-renderer which does the 3D rendering
                • vtree contains the experimental caching
                • web contains the HTML based application
                BarbourSmith 1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Powered by NodeBB | Contributors