Skip to content

Commit

Permalink
Build using head openscad
Browse files Browse the repository at this point in the history
  • Loading branch information
ochafik committed Dec 22, 2024
1 parent 0d1dc95 commit fc5686f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 127 deletions.
115 changes: 0 additions & 115 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ The WASM build was made possible by https://github.com/DSchroer/openscad-wasm.
* [GNU MP](#gnu-mp)
* [OpenSCAD](#openscad)
* [CGAL](#cgal)
* [Assimp](#assimp)
* [JSZip](#jszip)
* [UZIP.js](#uzipjs)
* [Manifold](#manifold)
* [Eigen](#eigen)
* [glib2](#glib2)
Expand Down Expand Up @@ -68,34 +66,6 @@ https://github.com/Stuk/jszip

Licensed under the [GPLv3](#gplv3) (actually dual-licensed under MIT, but we're picking this one here for brevity).

## UZIP.js

https://github.com/photopea/UZIP.js

```
MIT License
Copyright (c) 2018 Photopea
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```

## PrimeReact

https://github.com/primefaces/primereact
Expand Down Expand Up @@ -414,91 +384,6 @@ https://github.com/CGAL/cgal

Licensed under [GNU GPLv3](#gplv3) or later (note: some headers use the more permissive [GNU LGPLv3](#lgplv3) or later).

## assimp

https://github.com/assimp/assimp

```
Open Asset Import Library (assimp)
Copyright (c) 2006-2021, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
following conditions are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other
materials provided with the distribution.
* Neither the name of the assimp team, nor the names of its
contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
******************************************************************************
AN EXCEPTION applies to all files in the ./test/models-nonbsd folder.
These are 3d models for testing purposes, from various free sources
on the internet. They are - unless otherwise stated - copyright of
their respective creators, which may impose additional requirements
on the use of their work. For any of these models, see
<model-name>.source.txt for more legal information. Contact us if you
are a copyright holder and believe that we credited you inproperly or
if you don't want your files to appear in the repository.
******************************************************************************
Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors
http://code.google.com/p/poly2tri/
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of Poly2Tri nor the names of its contributors may be
used to endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
```

## Eigen

https://eigen.tuxfamily.org/
Expand Down
20 changes: 14 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
WASM_SNAPSHOT_JS_URL=https://files.openscad.org/snapshots/.snapshot_wasm.js
WASM_BUILD_URL=$(shell curl ${WASM_SNAPSHOT_JS_URL} 2>/dev/null | grep https | sed -E "s/.*(https:[^']+)'.*/\1/" )
# WASM_SNAPSHOT_JS_URL=https://files.openscad.org/snapshots/.snapshot_wasm.js
# WASM_BUILD_URL=$(shell curl ${WASM_SNAPSHOT_JS_URL} 2>/dev/null | grep https | sed -E "s/.*(https:[^']+)'.*/\1/" )

SINGLE_BRANCH_MAIN=--branch main --single-branch
SINGLE_BRANCH=--branch master --single-branch
Expand Down Expand Up @@ -52,10 +52,18 @@ src/wasm: libs/openscad-wasm
rm -f src/wasm
ln -sf "$(shell pwd)/libs/openscad-wasm" src/wasm

libs/openscad-wasm:
libs/openscad/build/openscad.js: libs/openscad
( cd libs/openscad && ./scripts/wasm-base-docker-run.sh emcmake cmake -B build -DCMAKE_BUILD_TYPE=Release -DEXPERIMENTAL=1 )
( cd libs/openscad && ./scripts/wasm-base-docker-run.sh cmake --build build )

libs/openscad-wasm: libs/openscad/build/openscad.js
mkdir -p libs/openscad-wasm
wget ${WASM_BUILD_URL} -O libs/openscad-wasm.zip
( cd libs/openscad-wasm && unzip ../openscad-wasm.zip )
cp libs/openscad/build/openscad.* libs/openscad-wasm/

# libs/openscad-wasm:
# mkdir -p libs/openscad-wasm
# wget ${WASM_BUILD_URL} -O libs/openscad-wasm.zip
# ( cd libs/openscad-wasm && unzip ../openscad-wasm.zip )

public/openscad.js: libs/openscad-wasm libs/openscad-wasm/openscad.js
ln -sf libs/openscad-wasm/openscad.js public/openscad.js
Expand Down Expand Up @@ -129,7 +137,7 @@ libs/liberation:
git clone --recurse https://github.com/shantigilbert/liberation-fonts-ttf.git ${SHALLOW} ${SINGLE_BRANCH} $@

libs/openscad:
git clone https://github.com/openscad/openscad.git ${SHALLOW} ${SINGLE_BRANCH} $@
git clone --recurse https://github.com/openscad/openscad.git ${SHALLOW} ${SINGLE_BRANCH} $@

public/libraries/openscad.zip: libs/openscad
mkdir -p public/libraries
Expand Down
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,6 @@ Prerequisites:
* npm
* docker

First, you need a WASM build of [a branch](https://github.com/openscad/openscad/pull/5180) that handles colors & exports to GLTF (will take a while):

```bash
./build-openscad-wasm.sh -DCMAKE_BUILD_TYPE=Release
```

Local dev:

```bash
Expand All @@ -68,6 +62,7 @@ Local prod (test both the different inlining and serving under a prefix):

```bash
make public
npm install
npm run start:prod
# http://localhost:3000/dist/
```
Expand All @@ -76,6 +71,7 @@ Deployment (edit "homepage" in `package.json` to match your deployment root!):

```bash
make public
npm install
npm run build

rm -fR ../ochafik.github.io/openscad2 && cp -R dist ../ochafik.github.io/openscad2
Expand Down

0 comments on commit fc5686f

Please sign in to comment.