Skip to content

An npx starter template for JsCad projects using Typescript and Hot Reload preview

Notifications You must be signed in to change notification settings

simplyhexagonal/create-jscad-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Create JSCAD Project

Introduction

An NPX starter template designed to kickstart your JSCAD projects using TypeScript and Hot Reload preview. This tool simplifies the process of setting up a JSCAD project, allowing you to focus on creating fully parametric CAD drawings with ease.

Demo GIF

Features

  • 🚀 Easy Setup: Initialize your JSCAD project with a single command.
  • 💻 TypeScript Support: Leverage the power of TypeScript for more robust code.
  • 🔁 Hot Reload Preview: Instantly view changes in your CAD design as you code.
  • 🔧 Automatic Interactive Controls: If you define parameters in your design, the viewport will render interactive controls that can be changed in the UI.
  • 📁 Automated Structure and Dependency Management: Automatically creates the necessary folder structure and installs dependencies.
  • 🎨 Focus on Design: Spend more time designing and less on setup.
  • 🛠️ Integrated VSCode Experience: Recommended extensions and launch configurations for a seamless development experience.
  • 📤 Advanced Export Options: Export your designs to X3D, 3MF, and SVG formats.

Like this project? ❤

Please consider:

Getting Started

Prerequisites

Ensure you have Node.js installed on your system to use npm or npx.

Installation

To create a new JSCAD project, run the following command in your terminal:

npm init jscad-project <your-project-name>

or

npx create-jscad-project <your-project-name>

This command will create a new directory with your project name, set up the folder structure, and install all the necessary dependencies.

Templates

To use a specific template, pass the --template argument when creating a new project. For example:

npm init jscad-project <your-project-name> -- --template=screw-and-nut

To list available templates you can run:

npx create-jscad-project --list-templates

There are currently two templates available:

  • default: A blank canvas for whatever project you're working on.
  • screw-and-nut: Contains a screw and nut for you to play with.

More templates will be added soon, hopefully by contributors too!

VSCode Integration

  • Recommended Extensions: The generated .vscode directory contains recommendations for helpful extensions. Please review and install them to enhance your development experience.
  • Launch Configuration: Use the "Launch JSCAD" configuration in the Run and Debug section of VSCode. This will open the drawing.ts file, run npm run dev, and open the preview browser.
    • Note: The first time you run this, the preview browser may initially display a white screen. Please wait until the debug output indicates that it's safe to reload the simple browser panel.

Alternatively - Development in other IDEs

If you are NOT using VSCode, or if you'd rather run the dev environment manually, then, after setting up your project, navigate to your project directory and start the development server:

cd <your-project-name>
npm run dev

Preview and Export

  • In the preview window, you have the option to export your designs to X3D and 3MF file formats.
  • To export to SVG, project any parts into 2D and ensure the "Projection" checkbox is turned on.

Related Projects and Resources

create-jscad-project is built upon and inspired by the capabilities of JSCAD. Here are some resources and related projects that can enhance your experience with JSCAD:

  • JSCAD: The core framework upon which this project is based. For more information and documentation, visit JSCAD's Github.

  • JSCAD Cheat Sheet: A handy guide for quick reference to JSCAD syntax and features. Perfect for beginners and experienced users alike. Check out the JSCAD Cheat Sheet.

  • Parametric Polysphericon Design Tutorial: Dive into a practical example of parametric design with JSCAD in this informative YouTube video by CodeDoodle. Watch the Parametric Polysphericon Design using JSCAD for insights and inspiration.

Contributing

Contributions are welcome! Feel free to submit pull requests or open issues to improve create-jscad-project.

Contributors

jeanlescure springbov z3dev

License

This project is licensed under the Apache-2.0.

Happy Designing with create-jscad-project!

About

An npx starter template for JsCad projects using Typescript and Hot Reload preview

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published