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

Class Plane

cadquery/occ_impl/geom.py:430–864  ·  view source on GitHub ↗

A 2D coordinate system in space A 2D coordinate system in space, with the x-y axes on the plane, and a particular point as the origin. A plane allows the use of 2D coordinates, which are later converted to global, 3d coordinates when the operations are complete. Frequently, it

Source from the content-addressed store, hash-verified

428
429
430class Plane(object):
431 """A 2D coordinate system in space
432
433 A 2D coordinate system in space, with the x-y axes on the plane, and a
434 particular point as the origin.
435
436 A plane allows the use of 2D coordinates, which are later converted to
437 global, 3d coordinates when the operations are complete.
438
439 Frequently, it is not necessary to create work planes, as they can be
440 created automatically from faces.
441 """
442
443 xDir: Vector
444 yDir: Vector
445 zDir: Vector
446 _origin: Vector
447
448 lcs: gp_Ax3
449 rG: Matrix
450 fG: Matrix
451
452 # equality tolerances
453 _eq_tolerance_origin = 1e-6
454 _eq_tolerance_dot = 1e-6
455
456 @classmethod
457 def named(cls: Type["Plane"], stdName: str, origin=(0, 0, 0)) -> "Plane":
458 """Create a predefined Plane based on the conventional names.
459
460 :param stdName: one of (XY|YZ|ZX|XZ|YX|ZY|front|back|left|right|top|bottom)
461 :type stdName: string
462 :param origin: the desired origin, specified in global coordinates
463 :type origin: 3-tuple of the origin of the new plane, in global coordinates.
464
465 Available named planes are as follows. Direction references refer to
466 the global directions.
467
468 =========== ======= ======= ======
469 Name xDir yDir zDir
470 =========== ======= ======= ======
471 XY +x +y +z
472 YZ +y +z +x
473 ZX +z +x +y
474 XZ +x +z -y
475 YX +y +x -z
476 ZY +z +y -x
477 front +x +y +z
478 back -x +y -z
479 left +z +y -x
480 right -z +y +x
481 top +x -z +y
482 bottom +x +z -y
483 =========== ======= ======= ======
484 """
485
486 namedPlanes = {
487 # origin, xDir, normal

Callers 15

test_Plane_from_LocationFunction · 0.90
testDXFMethod · 0.90
test_dxf_ellipse_arcFunction · 0.90
workplaneMethod · 0.85
cylinderMethod · 0.85
_getPlnMethod · 0.85
locationAtMethod · 0.85
namedMethod · 0.85
rotatedMethod · 0.85
planeMethod · 0.85
testYZPlaneOriginsMethod · 0.85
testXYPlaneOriginsMethod · 0.85

Calls

no outgoing calls

Tested by 15

test_Plane_from_LocationFunction · 0.72
testDXFMethod · 0.72
test_dxf_ellipse_arcFunction · 0.72
testYZPlaneOriginsMethod · 0.68
testXYPlaneOriginsMethod · 0.68
testXZPlaneOriginsMethod · 0.68
testVectorProjectMethod · 0.68
testPlaneEqualMethod · 0.68
testPlaneNotEqualMethod · 0.68
testInvalidPlaneMethod · 0.68
testPlaneMethodsMethod · 0.68
testCylinderPluginMethod · 0.68