Skip to content

Commit 4e9f657

Browse files
committed
adding freecad to the getting started instructions...
1 parent 6e634af commit 4e9f657

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

docs/gettingstarted.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ as well as in scriptable CAD software such as Blender, Rhino and Grasshopper.
1616
gettingstarted/rhino
1717
gettingstarted/grasshopper
1818
gettingstarted/blender
19+
gettingstarted/freecad
1920
gettingstarted/rhino5

docs/gettingstarted/freecad.rst

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
.. _gs-freecad:
2+
3+
*******
4+
FreeCAD
5+
*******
6+
7+
.. rst-class:: lead
8+
9+
Although there is no official support package for FreeCAD, working with COMPAS in FreeCAD is actually quite simple.
10+
11+
12+
Install FreeCAD
13+
===============
14+
15+
If FreeCAD is installed using ``conda``, the Python interpreter in FreeCAD automagically has access to all the packages installed in the same environment.
16+
17+
.. code-block:: bash
18+
19+
conda create -n CAD python=3.8 freecad COMPAS -c conda-forge --yes
20+
21+
22+
Launch FreeCAD
23+
==============
24+
25+
To activate this mechanism, you have to launch FreeCAD from the environment it is installed in.
26+
27+
.. code-block:: bash
28+
29+
conda activate CAD
30+
freecad
31+
32+
33+
Basic Usage
34+
===========
35+
36+
.. code-block:: python
37+
38+
>>> import Mesh
39+
>>> import compas
40+
>>> from compas.datastructures import Mesh as cMesh
41+
42+
.. code-block:: python
43+
44+
>>> mesh = cMesh.from_obj(compas.get('tubemesh.obj'))
45+
>>> mesh.quads_to_triangles()
46+
>>> freemesh = Mesh.Mesh(mesh.to_polygons())
47+
>>> Mesh.show(freemesh)

0 commit comments

Comments
 (0)