Skip to content

Commit f8e2cb0

Browse files
author
charles-sharman
committed
Corrected edge_bezier.png and replaced == None with is None
1 parent 9b287ff commit f8e2cb0

2 files changed

Lines changed: 33 additions & 21 deletions

File tree

src/contrib/ccad/model.py

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,43 @@
2323
12/17/11: Began
2424
01/09/12: Merged shapes and primitives into model.py
2525
to 1/11/14: Various Updates
26+
1/20/14: Replaced == None with is None
27+
28+
Philosophy
29+
----------
30+
31+
1. Edges are continuous lines in 3D space. There should be no reason
32+
to distinguish between them and OCC curves. Wires are collections
33+
of edge connections. Faces are continuous surfaces in 3D space.
34+
There should be no reason to distinguish between them and OCC
35+
surfaces. Shells are collections of face connections.
36+
37+
2. The end-user should not ever have to call pythonOCC directly. ccad
38+
should handle all things someone might want to do in CAD.
2639
2740
To Do
2841
-----
42+
2943
1. Allow shells (and 2D curves?) in the boolean operations.
44+
3045
2. Allow shell returns from cylinder, sphere, box, wedge, cone, torus.
31-
3. More robust error handling--usually shows a buried SWIG issue, which isn't helpful.
32-
4. Enhance the options to various routines to more encompass OCC's capabilities.
46+
47+
3. More robust error handling--usually shows a buried SWIG issue,
48+
which isn't helpful.
49+
50+
4. Enhance the options to various routines to more encompass OCC's
51+
capabilities.
52+
3353
5. Add parabola, hyperbola edges
54+
3455
6. Add edge intersection
35-
7. I never got OCC's concept of orientation in 3d. That caused a liberal use of .fix statements. It would be nice to get this right.
36-
8. Distinction between face, wire, solid, etc. can get muddled after certain operations, particularly boolean. Ought to be more careful about this.
56+
57+
7. I never got OCC's concept of orientation in 3d. That caused a
58+
liberal use of .fix statements. It would be nice to get this right.
59+
60+
8. Distinction between face, wire, solid, etc. can get muddled after
61+
certain operations, particularly boolean. Ought to be more careful
62+
about this.
3763
"""
3864

3965
import os
@@ -84,20 +110,6 @@
84110
from OCC.TopOpeBRepTool import *
85111
from OCC.TopTools import *
86112

87-
"""
88-
Shapes
89-
------
90-
91-
Philosophy
92-
----------
93-
Edges are continuous lines in 3D space. There should be no reason to
94-
distinguish between them and OCC curves. Wires are collections of
95-
edge connections. Faces are continuous surfaces in 3D space. There
96-
should be no reason to distinguish between them and OCC surfaces.
97-
Shells are collections of face connections.
98-
"""
99-
100-
101113
# Generic Functions
102114
def _explode_args(args):
103115
"""
@@ -1870,7 +1882,7 @@ def fillet(self, rad, edge_indices=None):
18701882
raw_edges = self._raw('edge')
18711883
if isinstance(rad, float):
18721884
# Make real edge_indices
1873-
if edge_indices == None:
1885+
if edge_indices is None:
18741886
edge_indices = range(len(raw_edges))
18751887
if len(edge_indices) <= 0:
18761888
return
@@ -1906,7 +1918,7 @@ def chamfer(self, dist, edge_indices=None):
19061918
TopExp_MapShapesAndAncestors(self.shape, TopAbs_EDGE, TopAbs_FACE, edge_map)
19071919
b = BRepFilletAPI_MakeChamfer(self.shape)
19081920
raw_edges = self._raw('edge')
1909-
if edge_indices == None:
1921+
if edge_indices is None:
19101922
edge_indices = range(len(raw_edges))
19111923
if len(edge_indices) <= 0:
19121924
return
@@ -2528,7 +2540,7 @@ def bezier_cone(rad1, rad2, height, angle=None):
25282540
coefficients to make a bezier a cone instead of revolving it.
25292541
Surfaces of revolution have their own problems.
25302542
"""
2531-
if angle == None:
2543+
if angle is None:
25322544
angle = 2.0 * sysmath.pi
25332545
e1 = bezier([(rad1, 0.0, 0.0), (rad2, 0.0, height)])
25342546
w1 = polygon([(rad2, 0.0, height),
-136 Bytes
Loading

0 commit comments

Comments
 (0)