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

Method trapezoid

cadquery/sketch.py:284–303  ·  view source on GitHub ↗

Construct a trapezoidal face.

(
        self: T,
        w: Real,
        h: Real,
        a1: Real,
        a2: Optional[float] = None,
        angle: Real = 0,
        mode: Modes = "a",
        tag: Optional[str] = None,
    )

Source from the content-addressed store, hash-verified

282 return self.each(lambda l: res.located(l), mode, tag)
283
284 def trapezoid(
285 self: T,
286 w: Real,
287 h: Real,
288 a1: Real,
289 a2: Optional[float] = None,
290 angle: Real = 0,
291 mode: Modes = "a",
292 tag: Optional[str] = None,
293 ) -> T:
294 """
295 Construct a trapezoidal face.
296 """
297
298 v1 = Vector(-w / 2, -h / 2)
299 v2 = Vector(w / 2, -h / 2)
300 v3 = Vector(-w / 2 + h / tan(radians(a1)), h / 2)
301 v4 = Vector(w / 2 - h / tan(radians(a2) if a2 else radians(a1)), h / 2)
302
303 return self.polygon((v1, v2, v4, v3, v1), angle, mode, tag)
304
305 def slot(
306 self: T,

Callers 2

test_face_interfaceFunction · 0.80
testSketchMethod · 0.80

Calls 2

polygonMethod · 0.95
VectorClass · 0.85

Tested by 2

test_face_interfaceFunction · 0.64
testSketchMethod · 0.64