Skip to content

Commit b95564f

Browse files
committed
Converted aply_to_each_face function to camelCase to mach CadQuery Style
1 parent 7d71a3c commit b95564f

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

plugins/apply_to_each_face/README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This plugin simplifies using
44
`Workplane.each(..)` on faces.
55
To use each you have to select workplane coordinate
66
system for each face before building your geometry.
7-
`Workplane.apply_to_each_face()` function provided by
7+
`Workplane.applyToEachFace()` function provided by
88
this plugin separates tasks of choosing face coordinate
99
system and actually building new geometry and provides
1010
a few built in ways of choosing coordinate system that
@@ -28,8 +28,8 @@ This plugin has no dependencies other than the cadquery library.
2828
## Usage
2929

3030
To use this plugin after it has been installed,
31-
just import it and use `apply_to_each_face(..)` function.
32-
`apply_to_each_face` has two arguments
31+
just import it and use `applyToEachFace(..)` function.
32+
`applyToEachFace` has two arguments
3333
both of which are callbacks
3434

3535
1. `f_workplane_selector(face)` callback accepts a face and returns
@@ -76,7 +76,7 @@ arbitrary faces. In some cases this requirement can be relaxed.
7676
## Example 1
7777
```python
7878
import cadquery as cq
79-
from apply_to_each_face import \
79+
from applyToEachFace import \
8080
XAxisInPlane,\
8181
WORLD_AXIS_PLANES_XY_ZX_YZ
8282

@@ -92,7 +92,7 @@ result =\
9292
main_body().union(
9393
main_body()\
9494
.faces()\
95-
.apply_to_each_face(
95+
.applyToEachFace(
9696
XAxisInPlane(WORLD_AXIS_PLANES_XY_ZX_YZ),
9797
lambda wp, face:\
9898
wp.circle(4).extrude(1)))
@@ -103,7 +103,7 @@ result =\
103103
## Example 2
104104
```python
105105
import cadquery as cq
106-
from apply_to_each_face import \
106+
from applyToEachFace import \
107107
XAxisInPlane,\
108108
WORLD_AXIS_PLANES_XY_ZX_YZ
109109

@@ -116,7 +116,7 @@ result =\
116116
main_body().union(
117117
main_body()\
118118
.faces("#Z")\
119-
.apply_to_each_face(
119+
.applyToEachFace(
120120
XAxisInPlane(WORLD_AXIS_PLANES_XY_YZ_ZX),
121121
lambda wp, face:\
122122
wp.rect(1,2).extrude(3)))
@@ -127,7 +127,7 @@ result =\
127127

128128
```python
129129
import cadquery as cq
130-
from apply_to_each_face import \
130+
from applyToEachFace import \
131131
XAxisInPlane,\
132132
WORLD_AXIS_PLANES_XY_ZX_YZ
133133

@@ -140,7 +140,7 @@ result =\
140140
main_body().faces("<Z").shell(-0.5).cut(
141141
main_body()\
142142
.faces("not <Z")\
143-
.apply_to_each_face(
143+
.applyToEachFace(
144144
XAxisInPlane(WORLD_AXIS_PLANES_XY_ZX_YZ),
145145
lambda wp, face:\
146146
wp.add(face)\
@@ -155,7 +155,7 @@ result =\
155155

156156
```python
157157
import cadquery as cq
158-
from apply_to_each_face import \
158+
from applyToEachFace import \
159159
XAxisInPlane,\
160160
WORLD_AXIS_PLANES_XY_ZX_YZ,\
161161
XAxisClosestTo,\
@@ -170,7 +170,7 @@ result_x_axis_in_plane =\
170170
main_body().union(
171171
main_body()\
172172
.faces("#Z")\
173-
.apply_to_each_face(
173+
.applyToEachFace(
174174
XAxisInPlane(WORLD_AXIS_PLANES_XY_ZX_YZ),
175175
lambda wp, face:\
176176
wp.rect(2,1).extrude(2)))
@@ -179,7 +179,7 @@ result_x_axis_closest_to =\
179179
main_body().union(
180180
main_body()\
181181
.faces("#Z")\
182-
.apply_to_each_face(
182+
.applyToEachFace(
183183
XAxisClosestTo(WORLD_AXIS_UNIT_VECTORS_XYZ),
184184
lambda wp, face:\
185185
wp.rect(2,1).extrude(2)))\
@@ -200,7 +200,7 @@ result =\
200200
main_body().union(
201201
main_body()\
202202
.faces()\
203-
.apply_to_each_face(
203+
.applyToEachFace(
204204
XAxisClosestTo(WORLD_AXIS_UNIT_VECTORS_ZXY),
205205
lambda wp, face:\
206206
wp.add(face)\

plugins/apply_to_each_face/apply_to_each_face.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import cadquery as cq
22

3-
def apply_to_each_face(wp, f_workplane_selector, f_draw):
3+
def applyToEachFace(wp, f_workplane_selector, f_draw):
44
def each_callback(face):
55
wp_face = f_workplane_selector(face)
66

@@ -165,4 +165,4 @@ def __call__(self, face):
165165
v_zaxis)
166166

167167

168-
cq.Workplane.apply_to_each_face = apply_to_each_face
168+
cq.Workplane.applyToEachFace = applyToEachFace

plugins/apply_to_each_face/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"simplifies using each(..) on faces. To use each "+\
88
"you have to select workplane coordinate system for each"+\
99
"face before building your geometry. "+\
10-
"apply_to_each_face() function provided by this plugin "+\
10+
"applyToEachFace() function provided by this plugin "+\
1111
"separates tasks of choosing face coordinate system and "+\
1212
"actually building new geometry and provides a few built in "+\
1313
"ways of choosing coordinate system that are good enough in "+\

0 commit comments

Comments
 (0)