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

Method geomType

cadquery/occ_impl/shapes.py:605–642  ·  view source on GitHub ↗

Gets the underlying geometry type. Implementations can return any values desired, but the values the user uses in type filters should correspond to these. As an example, if a user does:: CQ(object).faces("%mytype") The expectation is that the

(self)

Source from the content-addressed store, hash-verified

603 return cls.cast(s)
604
605 def geomType(self) -> Geoms:
606 """
607 Gets the underlying geometry type.
608
609 Implementations can return any values desired, but the values the user
610 uses in type filters should correspond to these.
611
612 As an example, if a user does::
613
614 CQ(object).faces("%mytype")
615
616 The expectation is that the geomType attribute will return 'mytype'
617
618 The return values depend on the type of the shape:
619
620 | Vertex: always 'Vertex'
621 | Edge: LINE, CIRCLE, ELLIPSE, HYPERBOLA, PARABOLA, BEZIER,
622 | BSPLINE, OFFSET, OTHER
623 | Face: PLANE, CYLINDER, CONE, SPHERE, TORUS, BEZIER, BSPLINE,
624 | REVOLUTION, EXTRUSION, OFFSET, OTHER
625 | Solid: 'Solid'
626 | Shell: 'Shell'
627 | Compound: 'Compound'
628 | Wire: 'Wire'
629
630 :returns: A string according to the geometry type
631 """
632
633 tr: Any = geom_LUT[shapetype(self.wrapped)]
634
635 if isinstance(tr, str):
636 rv = tr
637 elif tr is BRepAdaptor_Curve:
638 rv = geom_LUT_EDGE[tr(tcast(TopoDS_Edge, self.wrapped)).GetType()]
639 else:
640 rv = geom_LUT_FACE[tr(self.wrapped).GetType()]
641
642 return tcast(Geoms, rv)
643
644 def hashCode(self) -> int:
645 """

Callers 15

convert_and_validateFunction · 0.45
filterMethod · 0.45
filterMethod · 0.45
__init__Method · 0.45
solveMethod · 0.45
workplaneMethod · 0.45
ctrlPtsFunction · 0.45
_getAxisMethod · 0.45
fromEdgeMethod · 0.45
fromFaceMethod · 0.45
normalMethod · 0.45
arcCenterMethod · 0.45

Calls 1

shapetypeFunction · 0.85

Tested by 3

test2DDrawingMethod · 0.36
testCenterNthSelectorMethod · 0.36
test_textFunction · 0.36