Point#

class Point(**kwargs: float)[source]#

Bases: object

The 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

from_xy

Create a new Point instance with the given x and y coordinates.

from_xyz

Create a new Point instance with the given x, y, and z coordinates.

from_yz

Create a new Point instance with the given y and z coordinates.

from_zx

Create a new Point instance with the given z and x coordinates.

not_on_projection_planes

Get the plane keys in which point has no projection.

on_projection_planes

Get the plane keys in which point has a projection.

project

Project current point on another plane.

project_into_line

Projection of a line in axonometric picture plane out of its perpendicular point.

random_point

Get a random point.

reset_data

Reset point data.

Attributes

plane

The Plane of which the line is in; set by parent.

projections

Collection of the lines' projections; updated automatically.

x

X value in world coordinate space

y

Y value in world coordinate space

z

Z value in world coordinate space

key

The points' coordinate system, i.e. plane membership.

data

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.

Parameters:
  • x (float) – The x-coordinate of the point.

  • y (float) – The y-coordinate of the point.

Returns:

A new Point instance with the specified x and y coordinates.

Return type:

Point

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.

Parameters:
  • x (float) – The x-coordinate of the point.

  • y (float) – The y-coordinate of the point.

  • z (float) – The z-coordinate of the point.

Returns:

A new Point instance with the specified x, y, and z coordinates.

Return type:

Point

static Point.from_yz(y: float, z: float) Point[source]#

Create a new Point instance with the given y and z coordinates.

Parameters:
  • y (float) – The y-coordinate of the point.

  • z (float) – The z-coordinate of the point.

Returns:

A new Point instance with the specified y and z coordinates.

Return type:

Point

static Point.from_zx(z: float, x: float) Point[source]#

Create a new Point instance with the given z and x coordinates.

Parameters:
  • x (float) – The z-coordinate of the point.

  • y – The x-coordinate of the point.

  • z (float)

Returns:

A new Point instance with the specified z and x coordinates.

Return type:

Point

Point.not_on_projection_planes() list[str] | None[source]#

Get the plane keys in which point has no projection.

Return type:

list[str] | None

Point.on_projection_planes() list[str] | None[source]#

Get the plane keys in which point has a projection.

Return type:

list[str] | None

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 Line is basically handling its points, this method is extensively called in draw_line() and project(), with the points Line.start and Line.end as 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

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))
Parameters:
  • distance (float) – The position of the middle of the new line.

  • length (float) – The length of the new line.

  • ref_plane_keys (list[Literal['xy', 'yz', 'zx']] | None)

Returns:

A new Line on the axonometric picture plane.

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.

Parameters:

key (Literal['xy', 'yz', 'zx', 'xyz'])

Return type:

Point

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_applied boolean flag attribute.

Return type:

compas.geometry.Point

Attributes#

Point.plane: ReferencePlane | Axonometry#

The Plane of 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.