Point#
- class Point(**kwargs: float)[source]#
Bases:
objectThe atoms of geometry.
The coordinates have to be passed on explicitly:
Point(x=10, y=20) Point(z=15, y=20) Point(x=10, z=15) Point(x=10, y=20, z=15)
- Parameters:
kwargs (float) – A minimum of two coordanate values.
- Raises:
ValueError – A point is described by a minimum of two coordinates.
Methods
Create a new Point instance with the given x and y coordinates.
Create a new Point instance with the given x, y, and z coordinates.
Create a new Point instance with the given y and z coordinates.
Create a new Point instance with the given z and x coordinates.
Get the plane keys in which point has no projection.
Get the plane keys in which point has a projection.
Project current point on another plane.
Projection of a line in axonometric picture plane out of its perpendicular point.
Get a random point.
Reset point data.
Attributes
The
Planeof which the line is in; set by parent.Collection of the lines' projections; updated automatically.
X value in world coordinate space
Y value in world coordinate space
Z value in world coordinate space
The points' coordinate system, i.e. plane membership.
Position of point in view plane coordinate system.
Methods#
- static Point.from_xy(x: float, y: float) Point[source]#
Create a new Point instance with the given x and y coordinates.
- static Point.from_xyz(x: float, y: float, z: float) Point[source]#
Create a new Point instance with the given x, y, and z coordinates.
- static Point.from_yz(y: float, z: float) Point[source]#
Create a new Point instance with the given y and z coordinates.
- static Point.from_zx(z: float, x: float) Point[source]#
Create a new Point instance with the given z and x coordinates.
- Point.not_on_projection_planes() list[str] | None[source]#
Get the plane keys in which point has no projection.
- Point.on_projection_planes() list[str] | None[source]#
Get the plane keys in which point has a projection.
- Point.project(distance: float | None = None, ref_plane_key: Literal['xy', 'yz', 'zx'] | None = None, auxilaray_plane_key: Literal['xy', 'yz', 'zx'] | None = None) Point[source]#
Project current point on another plane.
Note
As modifying a
Lineis basically handling its points, this method is extensively called indraw_line()andproject(), with the pointsLine.startandLine.endas parameters.Two scenarios: current point is in a reference plane and is projected onto the axonometric picture plane. Or the current point is in the axonometric picture plane and is beeing projected on a reference plane. Depending, the right paramteres have to be provided.
- Parameters:
distance (float | None) – The missing third coordinate in order to project the point on the axonometric picture plane. This applies when the point to project is contained in a reference plane.
ref_plane_key (Literal['xy', 'yz', 'zx'] | None) – The selected reference plane on which to project the point. This applies when the point to project is on the axonometric picture plane.
auxilaray_plane_key (Literal['xy', 'yz', 'zx'] | None)
- Return type:
- Point.project_into_line(distance: float, length: float, ref_plane_keys: list[Literal['xy', 'yz', 'zx']] | None = None)[source]#
Projection of a line in axonometric picture plane out of its perpendicular point.
Instead of building a point, one adds a line in axo space.
>>> p_xy.project_into_line(distance=80, length=50) INFO:axonometry.plane:[XYZ] Add Line(Point(x=24, y=38, z=105.0), Point(x=24, y=38, z=55.0)) >>> p_yz.project_into_line(distance=80, length=50) INFO:axonometry.plane:[XYZ] Add Line(Point(x=105.0, y=29, z=51), Point(x=55.0, y=29, z=51)) >>> p_zx.project_into_line(distance=80, length=50) INFO:axonometry.plane:[XYZ] Add Line(Point(x=17, y=105.0, z=26), Point(x=17, y=55.0, z=26))
- static Point.random_point(key: Literal['xy', 'yz', 'zx', 'xyz'] = 'xyz') Point[source]#
Get a random point.
To follow architecture standards, z is always equal or higher than 0.
- Point.reset_data() compas.geometry.Point[source]#
Reset point data.
Function used to add objects a second time to a reference plane. Data needs a reset because by adding a point to a reference plane, the point.data is transformed with the planes matrix. This process is automated with the help of the
axonometry.Point.matrix_appliedboolean flag attribute.- Return type:
Attributes#
- Point.plane: ReferencePlane | Axonometry#
The
Planeof which the line is in; set by parent.
- Point.projections: dict[Literal['xy', 'yz', 'zx', 'xyz'], Point | list[Point]]#
Collection of the lines’ projections; updated automatically.
- Point.x#
X value in world coordinate space
- Point.y#
Y value in world coordinate space
- Point.z#
Z value in world coordinate space
- Point.key: Literal['xy', 'yz', 'zx', 'xyz']#
The points’ coordinate system, i.e. plane membership.
- Point.data: compas.geometry.Point | None#
Position of point in view plane coordinate system.