Skip to content

Commit

Permalink
binder also works now
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhard-42 committed Jan 3, 2023
1 parent d0b4c31 commit 92b7fcb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies:
- python=3.9
- pip=22.0
- numpy=1.22
- pythonocc-core=7.5.1
- occt=7.5.1
- pythonocc-core=7.6.2
- occt=7.6.2
- pip:
- cad-viewer-widget==1.4.1
19 changes: 19 additions & 0 deletions notebooks/Classic-OCC-Bottle.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,25 @@
"metadata": {},
"outputs": [],
"source": [
"from OCC.Core.Bnd import Bnd_Box\n",
"from OCC.Core.BRepBndLib import brepbndlib_Add\n",
"from OCC.Core.BRepMesh import BRepMesh_IncrementalMesh\n",
"\n",
"def get_boundingbox(shape, tol=1e-6, use_mesh=True):\n",
" bbox = Bnd_Box()\n",
" bbox.SetGap(tol)\n",
" if use_mesh:\n",
" mesh = BRepMesh_IncrementalMesh()\n",
" mesh.SetParallelDefault(True)\n",
" mesh.SetShape(shape)\n",
" mesh.Perform()\n",
" if not mesh.IsDone():\n",
" raise AssertionError(\"Mesh not done.\")\n",
" brepbndlib_Add(shape, bbox, use_mesh)\n",
"\n",
" xmin, ymin, zmin, xmax, ymax, zmax = bbox.Get()\n",
" return {\"xmin\": xmin, \"ymin\": ymin, \"zmin\":zmin, \"xmax\": xmax, \"ymax\": ymax, \"zmax\":zmax}\n",
" \n",
"bb = get_boundingbox(bottle)"
]
},
Expand Down

0 comments on commit 92b7fcb

Please sign in to comment.