Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tauri #1

Merged
merged 13 commits into from
May 9, 2023
13 changes: 6 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ name: Produce Desktop Binary Builds
on:
workflow_dispatch:
push:
tags:
- "v*"
branches:
- feature/tauri
- tauri
#- master
#- main

Expand Down Expand Up @@ -34,12 +32,13 @@ jobs:
matrix:
node-version: [18.x]
#, macos-latest
platform: [windows-latest, ubuntu-latest]
#windows-latest,
platform: [ubuntu-latest]
include:
- os: ubuntu-latest
rust_target: x86_64-unknown-linux-gnu
- os: windows-latest
rust_target: x86_64-pc-windows-msvc
#- os: windows-latest
# rust_target: x86_64-pc-windows-msvc
#- os: macos-latest
# rust_target: x86_64-apple-darwin
#- os: macos-latest
Expand Down Expand Up @@ -135,7 +134,7 @@ jobs:
with:
node-version: 18
- run: npm install -g conventional-changelog-conventionalcommits
- run: npm install -g semantic-release@v19.0.5
- run: npm install -g semantic-release@v21.0.2
- run: npm install -g @semantic-release/exec
- run: npm install -g @semantic-release/git
- run: npm install -g @semantic-release/release-notes-generator
Expand Down
9 changes: 7 additions & 2 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
{
"branches": [
"master",
"main",
"master",
"release",
{
"name": "feature/tauri",
"name": "tauri",
"prerelease": true
},
{
"name": "feature/tauri",
"prelease": true
}
],
"plugins": [
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"editor.codeActionsOnSave": {
"source.fixAll": true
},
"cSpell.words": ["clippy", "shakram", "tamasfe"]
"cSpell.words": ["appimage", "clippy", "jsketcher", "shakram", "tamasfe"]
}
43 changes: 43 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 📦 Changelog
[![conventional commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
[![semantic versioning](https://img.shields.io/badge/semantic%20versioning-2.0.0-green.svg)](https://semver.org)
> All notable changes to this project will be documented in this file

## 1.0.0-tauri.1 (2023-05-09)


### ⚠ BREAKING CHANGES

* CHANGES

### 🍕 Features

* add setup scripts for setting up tauri dev environment ([0c41a33](https://github.com/ZanzyTHEbar/jsketcher/commit/0c41a33d0e9dee8ecd645d04e9eb551980680941))
* **dxf:** add support for dimensions in dxf. ([56c884c](https://github.com/ZanzyTHEbar/jsketcher/commit/56c884ccfd551e0b2dcbee0fc0a0eff62fb6a338))
* add support for dxf blocks ([#200](https://github.com/ZanzyTHEbar/jsketcher/issues/200)) ([322d47f](https://github.com/ZanzyTHEbar/jsketcher/commit/322d47f80255d01b8bfcbaa110f0e790e91fa0d1))
* add support for dxf files import ([2fa2866](https://github.com/ZanzyTHEbar/jsketcher/commit/2fa2866296068bb785f3adeb6e18afe19a698100))
* finish up CI system ([5a688d1](https://github.com/ZanzyTHEbar/jsketcher/commit/5a688d1a9eec64d210ea140c9f9584fb4079a245))
* initial cir release ([2f94a6e](https://github.com/ZanzyTHEbar/jsketcher/commit/2f94a6eb82c91757d5e4b21ae4956dda3aadddfc))
* initial tauri commit ([0a0bb54](https://github.com/ZanzyTHEbar/jsketcher/commit/0a0bb5485e8f8d513115f210c57074d0e3e1c93e))
* update tauri version ([90168da](https://github.com/ZanzyTHEbar/jsketcher/commit/90168da42c37424180dece3c62acc2ca5f83dd50))


### 🐛 Bug Fixes

* .releasesrc file not having a main branch ([04f2e2c](https://github.com/ZanzyTHEbar/jsketcher/commit/04f2e2c6b77ee76bb14a584e7c7b273d5a0f5884))
* .releasesrc file not having a main branch ([25ae8a4](https://github.com/ZanzyTHEbar/jsketcher/commit/25ae8a464b90535596827ca023af93bb2fb64a0a))
* **dxf:** add dimLayers to the export. ([#183](https://github.com/ZanzyTHEbar/jsketcher/issues/183)) ([a3349b5](https://github.com/ZanzyTHEbar/jsketcher/commit/a3349b5da4c61de42ccebac76978da10c9e2d8f3))
* fix app not loading on linux builds ([9ef599d](https://github.com/ZanzyTHEbar/jsketcher/commit/9ef599ddc9e7175f35b9aa70c4a5b29210c797d5))
* fix release asset types ([8f73410](https://github.com/ZanzyTHEbar/jsketcher/commit/8f73410c7434d7c055fb405fcf11b99adf033db2))
* release to tauri ([0ba5387](https://github.com/ZanzyTHEbar/jsketcher/commit/0ba5387601ccf883021b18016de270b3be8e57c5))
* release to tauri branch ([11fcf2e](https://github.com/ZanzyTHEbar/jsketcher/commit/11fcf2e87acfd5e7cc9ac822046d405326b7d41b))
* release to tauri branch ([e8486a5](https://github.com/ZanzyTHEbar/jsketcher/commit/e8486a5e65d73bcb7bc6044147d4c9e8e7c36923))
* release to tauri branch ([6076573](https://github.com/ZanzyTHEbar/jsketcher/commit/6076573c989fb627453eb110d4ff5b8a79cc3ff0))
* remove caching of pnpm in ci ([96165f3](https://github.com/ZanzyTHEbar/jsketcher/commit/96165f3e1e24ef90cfc1c131ab681313f94b6d89))
* remove old path ([f0b426c](https://github.com/ZanzyTHEbar/jsketcher/commit/f0b426c14fecae1d09e06039ce273789693742ee))
* remove repo from package.json ([dd099b8](https://github.com/ZanzyTHEbar/jsketcher/commit/dd099b8ad8df081254f005ade8eaeef8978c215f))
* script for linux ([46bda82](https://github.com/ZanzyTHEbar/jsketcher/commit/46bda827261d9d17d0c09acbb7ec98972c8c5d8a))
* semantic-release ([3edb4cf](https://github.com/ZanzyTHEbar/jsketcher/commit/3edb4cf63516fe70f6cf2175c194bfaa03f25a6e))
* Update .releaserc ([3343d2c](https://github.com/ZanzyTHEbar/jsketcher/commit/3343d2cb4aed2facf5dbe14f4c8f8fca54e19c8c))
* update readme ([b00299d](https://github.com/ZanzyTHEbar/jsketcher/commit/b00299d5c1b1e199c1c0ca0dac49d42e204c5b29))
* windows failing to build ([def0782](https://github.com/ZanzyTHEbar/jsketcher/commit/def0782b76181ed7fbb662805d54abc703cb35c3))
142 changes: 88 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
JSketcher
# JSketcher

===========
![JSketcher Logo](./web/img/JSketcher-logo.svg)

JSketcher is a **parametric** 2D and 3D CAD modeler written for the web.
JSketcher is a **parametric** 2D and 3D CAD modeler written for the web.
Sketch solver is completely implemented in javascript/typescript.

<a href='https://www.youtube.com/watch?v=Vk3TTp8hNxQ&list=PLeoCiKHizvH8PZEyFvThHzVlnTF5XaL-R'>
Expand All @@ -20,86 +21,119 @@ Sketch solver is completely implemented in javascript/typescript.

[Workbench Dev Guide](./dev-guide/index.md)

[Comercial Licencing](https://www.autodrop3d.com/parametric-cad-beta.html)
[Commercial Licensing](https://www.autodrop3d.com/parametric-cad-beta.html)


Please consider supporting this project by becoming a backer

==============
<a href="https://opencollective.com/jsketcher-ad3d/"><image src="https://opencollective.com/jsketcher-ad3d/tiers/backer.svg?avatarHeight=300&width=3000"></image><image src="https://opencollective.com/jsketcher-ad3d/tiers/badge.svg"></image></a>

Current Status
## Current Status

==============

JSketcher is a parametric 3d modeler employing a 2D constraint solver for sketches and the feature/history metaphor to build models. The 2D constraint solver is completely written in javascript/typescript and is implemented in both the 3D CAD and the 2D sketcher. Originally developed by xibyte to make models for 3d printing. Today JSketcher provides a rich set of tools for visualizing, selecting/interacting with 3D geometry, tracking and storing model history all built on the foundation of the 2D sketcher engine and employing a custom wasm build of the OpenCascade kernel (https://github.com/Autodrop3d/occt-interpreter) for solid modeling operations.
`JSketcher` is a _parametric_ 3d modeler employing a 2D constraint solver for sketches and the feature/history metaphor to build models. The 2D constraint solver is completely written in javascript/typescript and is implemented in both the 3D CAD and the 2D sketcher. Originally developed by [`xibyte`](https://github.com/xibyte) to make models for 3d printing. Today `JSketcher` provides a rich set of tools for visualizing, selecting/interacting with 3D geometry, tracking and storing model history all built on the foundation of the 2D sketcher engine and employing a custom wasm build of the [OpenCascade kernel](https://github.com/Autodrop3d/occt-interpreter) for solid modeling operations.

## Major Components and features

Major Components and features
==============
* Geometric Constraint Solver. This is a most crucial component which allows to solve a system of geometric constraints applied to a sketch.
See below the list of supported constraints.
* 2D Sketcher. Allows to design 2d sketches applying geometric constraints. Uses HTML5 canvas for rendering.
* 3D Boolean engine. OpenCascade is used to perform booleans on BREP objects.
* Feature History. Accumulates features builds a 3d model step by step. A compare step is employed to propagate edge/face IDs forward to provide a stable and robust model.
* Export to **STL**, **DWG** and **SVG** formats
* Saving projects in the browser locale storage
* Repository of dimensions. For example if there is a line length constraint applied, it's not necessary to hardcode some length value.
A dimension with a symbolic name can be created and the constraint can refer to that dimension by name.
Once value of dimension gets changed the sketch is resolved again accordingly to the new dimension values.
* 2D measurement tool. Allows adding dimensions on a 2D drawing(Linear, Vertical, Horizontal and Arc/Circle dimension are supported)
* No any server-side needed. Only client side Javascript and wasm.

- Geometric Constraint Solver. This is a most crucial component which allows to solve a system of geometric constraints applied to a sketch.

> See below the list of supported constraints.

- 2D Sketcher. Allows to design 2d sketches applying geometric constraints. Uses HTML5 canvas for rendering.
- 3D Boolean engine. OpenCascade is used to perform booleans on `BREP` objects.
- Feature History. Accumulates features builds a 3d model step by step. A compare step is employed to propagate edge/face IDs forward to provide a stable and robust model.
- Export to **STL**, **DWG** and **SVG** formats
- Saving projects in the browser locale storage
- Repository of dimensions. For example if there is a line length constraint applied, it's not necessary to hardcode some length value.

> **Note**: A dimension with a symbolic name can be created and the constraint can refer to that dimension by name. Once value of dimension gets changed the sketch is resolved again accordingly to the new dimension values.

- 2D measurement tool. Allows adding dimensions on a 2D drawing(Linear, Vertical, Horizontal and Arc/Circle dimension are supported)
- No any server-side needed. Only client side Javascript and wasm.

This modeler is already used for:

* Designing of 3d models to get them 3d-printed. 3D models are based on parametric 2d sketches. All models can be exported as an STL file and 3d-printed after.
* Creating of 2d parametric sketches which could be exported to DWG or SVG format.
- Designing of 3d models to get them 3d-printed. 3D models are based on parametric `2D` sketches. All models can be exported as an STL file and 3d-printed after.
- Creating of 2d parametric sketches which could be exported to DWG or SVG format.

## Supported Constraints

Supported Constraints
=====================

* Coincident
* Vertical
* Horizontal
* Parallel
* Perpendicular
* Point to Line Distance
* Point to Object Distance
* Entity Equality(radius/length)
* Tangent
* Radius
* Point On Line
* Point On Arc / Ellipse
* Point In Middle
* Angle
* Symmetry
* Lock Convexity
* Fillet Meta Constraint

Get Started With the Code
- Coincident
- Vertical
- Horizontal
- Parallel
- Perpendicular
- Point to Line Distance
- Point to Object Distance
- Entity Equality(radius/length)
- Tangent
- Radius
- Point On Line
- Point On Arc / Ellipse
- Point In Middle
- Angle
- Symmetry
- Lock Convexity
- Fillet Meta Constraint

## Get Started With the Code

=========================

Install node.js
### Install node.js and packages

For this step, you can use any package manager you like.

We recommend using `pnpm`

```bash
npm install -g pnpm
```
npm install
npm start

```bash
pnpm install
pnpm start
```
Goto http://localhost:3000 using your browser. Tested on google chrome but known to work in firefox and edge.

Navigate `http://localhost:3000` using your browser. Tested on google chrome but known to work in firefox and edge.

Generate `Tauri` Build for desktop

Generate Electron Build for desktop
=========================


### Install Tauri Deps

Navigate to the [scripts](./scripts/) folder and run the following command:

```bash
chmod +x ./setup_tauri.sh
```
npm run electron:package:linux
npm run electron:package:win
npm run electron:package:mac


### Build for Desktop

```bash
pnpm tauri build
```

The resulting binary will be placed in the dist folder that is generated.
The resulting binary will be placed in the dist folder that is generated.

Note:
Build targeting windows from linux requires wine to be installed.
> **Note**: Build targeting windows from linux requires wine to be installed.

Linux build produces app image and deb for installation.
To use the app image you must do a `chmod`:

```bash
chmod +x jsketcher-*.*.*.AppImage
```

Linux build produces app image and deb for installation.
To use the app image you must do a 'chmod +x jsketcher-*.*.*.AppImage'
Contributing Please see [.github/CONTRIBUTING.md](.github/CONTRIBUTING.md )

Contributing Please see [.github/CONTRIBUTING.md ](.github/CONTRIBUTING.md )
=========================
11 changes: 3 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jsketcher",
"version": "0.1.0",
"version": "1.0.0",
"private": true,
"description": "JS.Sketcher is a parametric 2D and 3D CAD modeler written in pure javascript",
"scripts": {
Expand All @@ -17,14 +17,9 @@
"tauri:dev": "tauri dev",
"tauri:build": "tauri build",
"tauri:dev:release": "tauri dev --release",
"tauri:build": "tauri build",
"tauri:build:dev": "tauri build --debug",
"tauri:clean": "cd src-tauri && cargo clean"
},
"repository": {
"type": "git",
"url": "https://github.com/xibyte/jsketcher.git"
},
"keywords": [
"parametric",
"cad"
Expand All @@ -48,7 +43,7 @@
"@babel/preset-react": "^7.18.6",
"@babel/preset-stage-2": "^7.8.3",
"@babel/preset-typescript": "^7.18.6",
"@tauri-apps/cli": "^1.2.3",
"@tauri-apps/cli": "^1.3.1",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.9",
"@typescript-eslint/eslint-plugin": "^5.45.1",
Expand Down Expand Up @@ -85,7 +80,7 @@
"dependencies": {
"@dxfjs/parser": "^0.2.0",
"@tarikjabiri/dxf": "^2.6.2",
"@tauri-apps/api": "^1.2.0",
"@tauri-apps/api": "^1.3.0",
"@types/three": "^0.146.0",
"browser-xml2js": "^0.4.19",
"classnames": "^2.3.2",
Expand Down
Loading