GithubHelp home page GithubHelp logo

gmlewis / cadmium Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cadmium-co/cadmium

0.0 0.0 0.0 1.37 MB

A CAD program that runs in the browser

Home Page: https://cadmium-co.github.io/CADmium/

License: Other

Shell 0.11% JavaScript 7.81% Rust 49.16% TypeScript 12.98% CSS 0.07% HTML 0.08% Svelte 29.79%

cadmium's Introduction

CADmium

This project aims to create a new CAD program from scratch. It is small, it runs in a web browser, and the source code is available for free here on Github.

Legacy CAD programs have taken many thousands of years of collective engineering time to get where they are so this program will never be able to compete on breadth of features. But CADmium is intended to capture 80% of the most common CAD use cases while doing less than 10% of the work. For now we are targeting the home hobbyist who just wants to design a widget for their 3D printer, not a company that wants to design a car or airplane, although that will come later.

If you're looking for:

  • A simple, modern, parametric CAD UI that runs in a browser
  • That can export solids as .step, .obj, or .cadmium (a json-based CAD format that this project is inventing)
  • That can export sketches as .svg or .dxf
  • That works without an internet connection

Then this project may be for you!

Status: Early prototype. This tool is not yet an MVP, but is being developed in the open. Please do not share this to HN or Reddit or things like that. ha, well I guess that ship has sailed!

Overall Plan

Demos: We are currently racing toward our first demo release, V0.0.1. This is a good first exercise for us to decide on build and release processes.

After that we will do a few more demo (V0.0.*) releases, aggregating features until it feels pretty usable.

Alpha: When it feels like we've reached an MVP that people might actually want to use, it's time to release an Alpha version (V0.1.0) and actively solicit feedback from users. We'll use that feedback to make more improvements, re-inventing things if necessary to achieve a great workflow.

Beyond that, we'll see!

Technology

The boundary representation engine under the hood is truck, which is written in rust and is not dependent on any legacy b-rep engine.

Leveraging truck, we wrote a small rust library called cadmium which provides structs for projects, workspaces, sketches, extrusions, and constraints. Our goal is that this rust library provides all the same functionality as the UI for anyone who prefers code-first CAD. This library is able to save and load projects to disk as json. We have also built a set of javascript bindings so that the whole thing can be compiled to wasm and run in a browser.

The UI is built with SvelteKit and Tailwind. It is hosted with Github Pages. We use three.js for rendering, which in this case uses WebGL under the hood. We use Threlte to manage the scene graph declaratively.

License

This software is offered under the Elastic License 2.0. In summary, you can do whatever you like with this software except offer it as a service to third parties.

Running The Code

If you're just trying to kick the tires, click here to view the live web demo.

To build locally using pnpm workspace & turbo:

git clone https://github.com/Cadmium-Co/CADmium.git
cd CADmium
pnpm install
pnpm dev

Tooling setup

pnpm

We use pnpm to manage the monorepo. Please follow the instructions here to install: https://pnpm.io/installation#using-a-standalone-script

If you're new to node you can use pnpm to manage nodejs:

# https://pnpm.io/cli/env#use
pnpm env use --global 20

rust

First install rust using rustup: https://rustup.rs

Then install wasm-pack

cargo install wasm-pack

Running Tests

turbo test

Playwright is used for e2e testing. You may be prompted with a command to install it.

For manjaro/archlinux folks it may report missing dependencies. On manjaro the missing dependencies are solved thanks to this comment:

yay -S aur/enchant1.6 aur/icu66 aur/libwebp052

Watch vitest unit tests only:

cd applications/web
pnpm test:unit -w 

rust

Change the working directory to packages/cadmium and to run rust tests:

cd packages/cadmium
cargo test

Contributing

We are actively seeking contributors! Please join the Discord and come help out!

Most especially, we need help in the following areas:

Design: The tool must look and feel good and we are not designers. We would love contributions in the form of:

  • Advice, mockups, or tailwindcss examples of how to make different elements look and behave better
  • In particular, help picking a color palette that works well and is unique
  • Help figuring out how to implement dark mode

Rust: This is our first project in Rust. We need help from experienced Rustaceans to:

  • Figure out how to better lay out the rust code
  • Point out any glaring issues with how I'm using the language (We've thus far completely avoided Lifetimes, Traits, Rc, RefCell, etc and that may be hampering things)

Svelte: This is our first project using Svelte. We'd love an experienced set of eyes to:

  • Look over the basic structure and tell us if we're making any big mistakes
  • Help us migrate to Svelte 5 when it comes out

If you feel like you would be willing and able to help, please join our discord!

Immediate TODOs for V0.0.1 release (The Demo)

Github project for tracking progress is here

  • Sketching
    • Implement a standalone first-order 2D constraint solver
    • Integrate that new solver into sketch.rs
    • Ability to create a sketch on the face of a solid
    • Ability to create and modify constraints in the UI
  • Extrusion
    • Configure an extrusion to create new solid or subtract from existing solid
  • Project
    • Ability to rename the project
    • Ability to delete steps
    • bind ctrl + s to .cadmium export, and ctrl + o to .cadmium import
  • Units
    • Make it clear that the whole file uses millimeter units
  • Marketing
    • Youtube video demonstrating how to make:
      • A simple cube
      • A plate with screw holes
      • Something pretty complex like this

cadmium's People

Contributors

av8ta avatar drewbt avatar dzervas avatar eltociear avatar mattferraro avatar oyvindnetland avatar soshochang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.