HackerTrans
TopNewTrendsCommentsPastAskShowJobs

sgenoud

no profile record

Submissions

Show HN: Replicad, the Library for CAD in the Browser

replicad.xyz
101 points·by sgenoud·3 anni fa·32 comments

comments

sgenoud
·3 anni fa·discuss
I will have a look if OpenCascade has a more recent API which saves in the up to date standard. How do you check that a file follows the latest standard?
sgenoud
·3 anni fa·discuss
Something like this? https://blingmything.sgenoud.com/

You can find the code (with SVG import) here: https://github.com/sgenoud/replicad-decorate and https://github.com/sgenoud/blingmything

And use it like this (it does not work in Firefox yet, it needs module workers): https://studio.replicad.xyz/workbench?code=UEsDBAoAAAAIAIyZV...
sgenoud
·3 anni fa·discuss
I could not find any great documentation. I mostly learnt by reading CadQuery's code and implementing in Typescript.

Once you get how it works googling the name of the OC methods helps sometimes. But there is not much around.
sgenoud
·3 anni fa·discuss
We are a loose group of people who interact a little bit!

The person maintaining OCJS works on in bursts - it depends on the time he has. He is doing a great job at it!

The difference between replicad and Cascade Studio is that replicad is a library first - that you can include in your specific project. As a proof of concept I built a development environment while Cascade Studio is meant as a development environment first. Different aims with different tradeoffs.

People around code cad have been interacting a bit in the CadHub discord - but it is a bit quieter lately!
sgenoud
·3 anni fa·discuss
> - It would be great to have notebook-like UI to isolate steps and allow faster partial rebuilds.

Great idea, I have done something in that spirit integrating with natto.dev, but something more like a repl might be nice as well (https://natto.dev/@sgenoud/e2ade00d1fb4406abe78061e7f9a959b)

> - Search on API/docs page would be really handy

Good point, I use docusaurus, there is an algolia integration, I will look into it!

> Even if it's just an index that would break if topology has changed. Auto-generating stable references/filters would be even better, when possible.

Definitely the reference should be easy to implement, the stable one... less so.

I have tried to implement a filtering method inspired by cad query but which did not invent its own DSL. Always interested in feedback!
sgenoud
·3 anni fa·discuss
There are two main ways of representing 3D objects, BRep and mesh.

BRep is the equivalent of a vector image. It has the advantage of having the notions of faces and edges within the representation. This is what replicad uses.

Meshes is the equivalent of a raster image. This is how 3D art is usually made. It has some performance advantages. This is what JSCAD uses.

The reason the example took some time to load is that the code needed to get to the page a first time. After this it is snappy everywhere.
sgenoud
·3 anni fa·discuss
> How hard would it be to make your workbench pull and render code from GitHub repositories, so that for example, authors can link to a render of the codebase in their readme?

You can already do some of this. Either by pointing to an encoded url (something like this: https://studio.replicad.xyz/workbench?from-url=https%253A%25...).

There is also a share arrow which will put the current code in an url param (and you can have something like this: https://studio.replicad.xyz/workbench?code=UEsDBAoAAAAIANhzV...
sgenoud
·3 anni fa·discuss
I have been working for a while on this library to do CAD in the browser.

The main inspiration were CadQuery and cascade studio. These are two great projects, but my needs were different.

Originally I wanted to create a browser based generator for token trays. I prefer not to have any code running on a server (so I don’t need to pay or operate them). So CadQuery was out of the picture. It needed to be in javascript.

I really liked what Cascade Studio was doing - but I wanted to create my own UI for configuring boxes - and the studio is only an integrated environment - there was no library to just make the models.

So replicad was born! You can read the docs at https://replicad.xyz/ (and play with the workbench at https://studio.replicad.xyz/workbench)