MCPcopy
hub / github.com/CadQuery/cadquery / face

Method face

cadquery/sketch.py:190–219  ·  view source on GitHub ↗

Construct a face from a wire or edges.

(
        self: T,
        b: Union[Wire, Iterable[Edge], Shape, T],
        angle: Real = 0,
        mode: Modes = "a",
        tag: Optional[str] = None,
        ignore_selection: bool = False,
    )

Source from the content-addressed store, hash-verified

188
189 # face construction
190 def face(
191 self: T,
192 b: Union[Wire, Iterable[Edge], Shape, T],
193 angle: Real = 0,
194 mode: Modes = "a",
195 tag: Optional[str] = None,
196 ignore_selection: bool = False,
197 ) -> T:
198 """
199 Construct a face from a wire or edges.
200 """
201
202 res: Union[Face, Sketch, Compound]
203
204 if isinstance(b, Wire):
205 res = Face.makeFromWires(b)
206 elif isinstance(b, Sketch):
207 res = b
208 elif isinstance(b, Shape):
209 res = Compound.makeCompound(b.Faces())
210 elif isinstance(b, Iterable):
211 wires = edgesToWires(tcast(Iterable[Edge], b))
212 res = Face.makeFromWires(*(wires[0], wires[1:]))
213 else:
214 raise ValueError(f"Unsupported argument {b}")
215
216 if angle != 0:
217 res = res.moved(Location(Vector(), Vector(0, 0, 1), angle))
218
219 return self.each(lambda l: res.moved(l), mode, tag, ignore_selection)
220
221 def importDXF(
222 self: T,

Callers 15

importDXFMethod · 0.95
slotMethod · 0.95
polygonMethod · 0.95
hullMethod · 0.95
offsetMethod · 0.95
assembleMethod · 0.95
_split_showablesFunction · 0.45
ctrlPtsFunction · 0.45
test_periodic_loftFunction · 0.45
test_loftFunction · 0.45
test_approximate2DFunction · 0.45
torus_faceFunction · 0.45

Calls 8

eachMethod · 0.95
edgesToWiresFunction · 0.85
LocationClass · 0.85
VectorClass · 0.85
makeCompoundMethod · 0.80
makeFromWiresMethod · 0.45
FacesMethod · 0.45
movedMethod · 0.45

Tested by 15

test_periodic_loftFunction · 0.36
test_loftFunction · 0.36
test_approximate2DFunction · 0.36
torus_faceFunction · 0.36
test_isolinesFunction · 0.36
test_face_interfaceFunction · 0.36
test_single_ent_selectorFunction · 0.36
test_reverseFunction · 0.36
test_siblingsFunction · 0.36
test_prismFunction · 0.36
test_prism_taperFunction · 0.36
test_draftFunction · 0.36