Skip to content

Commit 2dbd56c

Browse files
authored
added Colab Python example (elalish#648)
added colab example
1 parent 0e168dc commit 2dbd56c

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

README.md

+12-9
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,22 @@
77

88
[OpenSCAD](https://openscad.org/), [IFCjs](https://ifcjs.github.io/info/), [Grid.Space](https://grid.space/), and [OCADml](https://github.com/OCADml/OManifold) have all integrated our Manifold geometry kernel! Why? Because its reliability is guaranteed and it's 1,000 times faster than other libraries. See our [usage](https://github.com/elalish/manifold/discussions/340) and [performance](https://github.com/elalish/manifold/discussions/383) discussions for all the latest and to add your own projects & analyses.
99

10-
## [ManifoldCAD.org](https://manifoldcad.org)
10+
## Manifold Frontend Sandboxes
1111

12-
If you like OpenSCAD / JSCAD, you might also like ManifoldCAD - our own solid modelling web app. Our WASM is not multithreaded yet, but it's still quite fast and a good way to test out our Manifold library.
12+
### [ManifoldCAD.org](https://manifoldcad.org)
1313

14-
![A metallic Menger sponge](https://elalish.github.io/manifold/samples/models/mengerSponge3.webp "A metallic Menger sponge")
15-
16-
### Note for Firefox users
14+
If you like OpenSCAD / JSCAD, you might also like ManifoldCAD - our own solid modelling web app where you script in JS/TS. This uses our npm package, [manifold-3d](https://www.npmjs.com/package/manifold-3d), built via WASM. It's not quite as fast as our raw C++, but it's hard to beat for interoperability.
1715

18-
If you find the editor is stuck on **Loading...**, setting
19-
`dom.workers.modules.enabled: true` in your `about:config`, as mentioned in the
20-
discussion of the
16+
*Note for Firefox users: If you find the editor is stuck on **Loading...**, setting
17+
`dom.workers.modules.enabled: true` in your `about:config`, as mentioned in
2118
[issue#328](https://github.com/elalish/manifold/issues/328#issuecomment-1473847102)
22-
of this repository may solve the problem.
19+
may solve the problem.*
20+
21+
### [Python Colab Example](https://colab.research.google.com/drive/1VxrFYHPSHZgUbl9TeWzCeovlpXrPQ5J5?usp=sharing)
22+
23+
If you prefer Python to JS/TS, make your own copy of the example notebook above. It demonstrates interop between our [`manifold3d`](https://pypi.org/project/manifold3d/) PyPI library and the popular [`trimesh`](https://pypi.org/project/trimesh/) library, including showing the interactive model right in the notebook and saving 3D model output.
24+
25+
![A metallic Menger sponge](https://elalish.github.io/manifold/samples/models/mengerSponge3.webp "A metallic Menger sponge")
2326

2427
# Manifold
2528

bindings/python/examples/sponge.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def fractal(holes, hole, w, position, depth, maxDepth):
2424

2525

2626
def posColors(pos, _):
27-
return [1 - p / 2 for p in pos] + [1.0]
27+
return [-p + 0.5 for p in pos] + [1.0]
2828

2929

3030
def run(n=1):

0 commit comments

Comments
 (0)