|
23 | 23 | 12/17/11: Began |
24 | 24 | 01/09/12: Merged shapes and primitives into model.py |
25 | 25 | 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. |
26 | 39 |
|
27 | 40 | To Do |
28 | 41 | ----- |
| 42 | +
|
29 | 43 | 1. Allow shells (and 2D curves?) in the boolean operations. |
| 44 | +
|
30 | 45 | 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 | +
|
33 | 53 | 5. Add parabola, hyperbola edges |
| 54 | +
|
34 | 55 | 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. |
37 | 63 | """ |
38 | 64 |
|
39 | 65 | import os |
|
84 | 110 | from OCC.TopOpeBRepTool import * |
85 | 111 | from OCC.TopTools import * |
86 | 112 |
|
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 | | - |
101 | 113 | # Generic Functions |
102 | 114 | def _explode_args(args): |
103 | 115 | """ |
@@ -1870,7 +1882,7 @@ def fillet(self, rad, edge_indices=None): |
1870 | 1882 | raw_edges = self._raw('edge') |
1871 | 1883 | if isinstance(rad, float): |
1872 | 1884 | # Make real edge_indices |
1873 | | - if edge_indices == None: |
| 1885 | + if edge_indices is None: |
1874 | 1886 | edge_indices = range(len(raw_edges)) |
1875 | 1887 | if len(edge_indices) <= 0: |
1876 | 1888 | return |
@@ -1906,7 +1918,7 @@ def chamfer(self, dist, edge_indices=None): |
1906 | 1918 | TopExp_MapShapesAndAncestors(self.shape, TopAbs_EDGE, TopAbs_FACE, edge_map) |
1907 | 1919 | b = BRepFilletAPI_MakeChamfer(self.shape) |
1908 | 1920 | raw_edges = self._raw('edge') |
1909 | | - if edge_indices == None: |
| 1921 | + if edge_indices is None: |
1910 | 1922 | edge_indices = range(len(raw_edges)) |
1911 | 1923 | if len(edge_indices) <= 0: |
1912 | 1924 | return |
@@ -2528,7 +2540,7 @@ def bezier_cone(rad1, rad2, height, angle=None): |
2528 | 2540 | coefficients to make a bezier a cone instead of revolving it. |
2529 | 2541 | Surfaces of revolution have their own problems. |
2530 | 2542 | """ |
2531 | | - if angle == None: |
| 2543 | + if angle is None: |
2532 | 2544 | angle = 2.0 * sysmath.pi |
2533 | 2545 | e1 = bezier([(rad1, 0.0, 0.0), (rad2, 0.0, height)]) |
2534 | 2546 | w1 = polygon([(rad2, 0.0, height), |
|
0 commit comments