Skip to content

Commit 7f1036a

Browse files
authored
Merge pull request #11 from shimwell/simpler-examples-in-readme
more minimal examples
2 parents d459aaf + 9efe906 commit 7f1036a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ insert.faces("<X").tag("~in_contact")
5151
insert.faces(">X").tag("outer-right")
5252

5353
assy = cq.Assembly()
54-
assy.add(shell, name="shell", loc=cq.Location(cq.Vector(0, 0, 0)), color=cq.Color("red"))
55-
assy.add(insert, name="insert", loc=cq.Location(cq.Vector(0, 0, 0)), color=cq.Color("blue"))
54+
assy.add(shell, name="shell")
55+
assy.add(insert, name="insert")
5656

5757
assy.saveToGmsh(mesh_path="tagged_mesh.msh")
5858
```
@@ -63,7 +63,7 @@ If you want more control over the mesh generation and export, you can use the `g
6363

6464
```python
6565
import cadquery as cq
66-
import cadquery_assembly_mesh_plugin.plugin
66+
import assembly_mesh_plugin.plugin
6767
import gmsh
6868

6969
shell = cq.Workplane("XY").box(50, 50, 50)
@@ -77,17 +77,17 @@ insert.faces("<X").tag("~in_contact")
7777
insert.faces(">X").tag("outer-right")
7878

7979
assy = cq.Assembly()
80-
assy.add(shell, name="shell", loc=cq.Location(cq.Vector(0, 0, 0)), color=cq.Color("red"))
81-
assy.add(insert, name="insert", loc=cq.Location(cq.Vector(0, 0, 0)), color=cq.Color("blue"))
80+
assy.add(shell, name="shell")
81+
assy.add(insert, name="insert")
8282

8383
# Get a Gmsh object back with all the tagged faces as physical groups
84-
gmsh = assy.getTaggedGmsh()
84+
gmsh_object = assy.getTaggedGmsh()
8585

8686
# Generate the mesh and write it to the file
87-
gmsh.model.mesh.field.setAsBackgroundMesh(2)
88-
gmsh.model.mesh.generate(3)
89-
gmsh.write(mesh_path)
90-
gmsh.finalize()
87+
gmsh_object.model.mesh.field.setAsBackgroundMesh(2)
88+
gmsh_object.model.mesh.generate(3)
89+
gmsh_object.write("tagged_mesh.msh")
90+
gmsh_object.finalize()
9191
```
9292

9393
## Tests

0 commit comments

Comments
 (0)