ostk.mathematics.geometry.d2.Object¶
- class Object¶
Bases:
pybind11_objectMethods
Apply a transformation to the 2D object in place.
Check if this 2D object contains another object.
Check if this 2D object intersects with another object.
Check if the 2D object is defined.
- class Format(self: ostk.mathematics.geometry.d2.Object.Format, value: int)¶
Bases:
pybind11_objectMembers:
Undefined
Standard
WKT
- property name¶
- apply_transformation(
- self: ostk.mathematics.geometry.d2.Object,
- transformation: ostk::mathematics::geometry::d2::Transformation,
Apply a transformation to the 2D object in place.
- Parameters:
transformation (Transformation) -- The 2D transformation to apply.
Example
>>> point = Point(1.0, 2.0) >>> transformation = Translation([1.0, 1.0]) >>> point.apply_transformation(transformation)
- contains( ) bool¶
Check if this 2D object contains another object.
- Parameters:
object (Object) -- The object to check containment for.
- Returns:
True if this object contains the other, False otherwise.
- Return type:
Example
>>> polygon = Polygon([Point(0.0, 0.0), Point(2.0, 0.0), Point(2.0, 2.0)]) >>> point = Point(1.0, 1.0) >>> polygon.contains(point) # True
- intersects( ) bool¶
Check if this 2D object intersects with another object.
- Parameters:
object (Object) -- The object to check intersection with.
- Returns:
True if objects intersect, False otherwise.
- Return type:
Example
>>> line1 = Line(Point(0.0, 0.0), numpy.array([1.0, 0.0])) >>> line2 = Line(Point(0.0, -1.0), numpy.array([0.0, 1.0])) >>> line1.intersects(line2) # True
- is_defined(self: ostk.mathematics.geometry.d2.Object) bool¶
Check if the 2D object is defined.
- Returns:
True if the object is defined, False otherwise.
- Return type:
Example
>>> point = Point(1.0, 2.0) >>> point.is_defined() # True