PadelCourt

PadelCourt is the main court geometry model. It combines physical CourtDimensions with optional descriptive metadata (enclosure type, location, door states, etc.) and exposes methods to retrieve standardised landmark positions in either of the two supported coordinate systems.

Properties

  • Name
    dimensions
    Type
    CourtDimensions
    Description

    The physical measurements of the court. See CourtDimensions.

  • Name
    length
    Type
    float
    Description

    Total length of the court in meters. Shorthand for dimensions.length.

  • Name
    width
    Type
    float
    Description

    Total width of the court in meters. Shorthand for dimensions.width.

  • Name
    enclosure_type
    Type
    EnclosureType | None
    Description

    The material used for the enclosure walls, if set.

  • Name
    enclosure_variant
    Type
    EnclosureVariant | None
    Description

    The regulatory enclosure variant, if set.

  • Name
    orientation
    Type
    CourtOrientation | None
    Description

    The cardinal orientation of the court's length axis, if set.

  • Name
    turf_color
    Type
    str | None
    Description

    The color of the artificial turf, if set.

  • Name
    door_left
    Type
    DoorState | None
    Description

    State of the left lateral access door, if set.

  • Name
    door_right
    Type
    DoorState | None
    Description

    State of the right lateral access door, if set.

  • Name
    location
    Type
    CourtLocation | None
    Description

    Structured geographic location of the court, if set.


Initialization

Creates a new instance of PadelCourt.

Keyword Arguments

  • Name
    dimensions
    Type
    CourtDimensions
    Description

    The physical measurements of the court. See CourtDimensions.

  • Name
    enclosure_type
    Type
    EnclosureType | None
    Description

    The material used for the enclosure walls (EnclosureType.GLASS or EnclosureType.WALL).

  • Name
    enclosure_variant
    Type
    EnclosureVariant | None
    Description

    The regulatory variant as defined by the FIP (EnclosureVariant.V1 or EnclosureVariant.V2).

  • Name
    orientation
    Type
    CourtOrientation | None
    Description

    The cardinal orientation of the court's length axis (CourtOrientation.NORTH_SOUTH or CourtOrientation.EAST_WEST).

  • Name
    turf_color
    Type
    str | None
    Description

    The color of the artificial turf (e.g., "blue", "green").

  • Name
    door_left
    Type
    DoorState | None
    Description

    State of the left lateral door, from the perspective of a player on the near side facing the net.

  • Name
    door_right
    Type
    DoorState | None
    Description

    State of the right lateral door, from the same perspective as door_left.

  • Name
    location
    Type
    CourtLocation | None
    Description

    Structured geographic location of the court. See CourtLocation.

Instantiation

class
PadelCourt
from padelkit import (
    PadelCourt,
    CourtDimensions,
    CourtLocation,
    EnclosureType,
    EnclosureVariant,
    DoorState,
)

court = PadelCourt(
    dimensions=CourtDimensions.fip_standard(),
    enclosure_type=EnclosureType.GLASS,
    enclosure_variant=EnclosureVariant.V1,
    turf_color="blue",
    door_left=DoorState.OPEN,
    door_right=DoorState.CLOSED,
    location=CourtLocation(
        club="Club de Pádel Sol",
        city="Madrid",
        country="Spain",
        latitude=40.4168,
        longitude=-3.7038,
    ),
)

Output structure

PadelCourt(
  dimensions=CourtDimensions(length=20.0, width=10.0, ...),
  enclosure_type=<EnclosureType.GLASS: 'glass'>,
  enclosure_variant=<EnclosureVariant.V1: 1>,
  orientation=None,
  turf_color='blue',
  door_left=<DoorState.OPEN: 'open'>,
  door_right=<DoorState.CLOSED: 'closed'>,
  location=CourtLocation(club='Club de Pádel Sol', ...)
)

classmethodPadelCourt.fip_standard()

FIP Standard

Creates a PadelCourt with standard FIP dimensions and no optional metadata. All optional fields default to None.

Usage

classmethod
fip_standard
from padelkit import PadelCourt

court = PadelCourt.fip_standard()

Output

PadelCourt(
  dimensions=CourtDimensions(
    length=20.0,
    width=10.0,
    net_height_center=0.88,
    net_height_posts=0.92,
    service_line_distance_from_back=3.0,
    back_wall_height=4.0,
    side_wall_height=3.0
  ),
  enclosure_type=None,
  enclosure_variant=None,
  orientation=None,
  turf_color=None,
  door_left=None,
  door_right=None,
  location=None
)

methodcourt.landmarks_2d()

List 2D landmarks

Returns a dictionary of all 13 standard floor-level landmarks as (X, Y) coordinate pairs. Useful for drawing the court outline or passing positions to analytics tools.

Keyword Arguments

  • Name
    coordinate_system
    Type
    CoordinateSystem
    Description

    The reference frame for the returned coordinates. See the coordinate systems guide.

Returns

  • Name
    landmarks
    Type
    dict[str, tuple[float, float]]
    Description

    A dictionary mapping each Landmark value string to its (X, Y) position.

Usage

method
landmarks_2d
from padelkit import PadelCourt, CoordinateSystem

court = PadelCourt.fip_standard()

# Default: centered system
points = court.landmarks_2d()

# Or: corner-based system (padelamix compatible)
points_cb = court.landmarks_2d(
    coordinate_system=CoordinateSystem.CORNER_BASED
)

Output (CENTERED)

{
  "floor_near_left":     [-5.0, -10.0],
  "floor_near_right":    [ 5.0, -10.0],
  "service_near_left":   [-5.0,  -7.0],
  "service_near_center": [ 0.0,  -7.0],
  "service_near_right":  [ 5.0,  -7.0],
  "net_left":            [-5.0,   0.0],
  "center":              [ 0.0,   0.0],
  "net_right":           [ 5.0,   0.0],
  "service_far_left":    [-5.0,   7.0],
  "service_far_center":  [ 0.0,   7.0],
  "service_far_right":   [ 5.0,   7.0],
  "floor_far_left":      [-5.0,  10.0],
  "floor_far_right":     [ 5.0,  10.0]
}

methodcourt.landmarks_3d()

List 3D landmarks

Returns a dictionary of all 17 standard landmarks as (X, Y, Z) coordinate triples. Floor points have Z = 0. Back-wall top points have Z = dimensions.back_wall_height (4.0 m in a standard FIP court).

Keyword Arguments

  • Name
    coordinate_system
    Type
    CoordinateSystem
    Description

    The reference frame for the returned coordinates. See the coordinate systems guide.

Returns

  • Name
    landmarks
    Type
    dict[str, tuple[float, float, float]]
    Description

    A dictionary mapping each Landmark value string to its (X, Y, Z) position.

Usage

method
landmarks_3d
from padelkit import PadelCourt, CoordinateSystem

court = PadelCourt.fip_standard()

# Default: centered system
points_3d = court.landmarks_3d()

# Corner-based (padelamix pipeline format)
points_3d_cb = court.landmarks_3d(
    coordinate_system=CoordinateSystem.CORNER_BASED
)

Output (CENTERED, abridged)

{
  "floor_near_left":      [-5.0, -10.0, 0.0],
  "center":               [ 0.0,   0.0, 0.0],
  "floor_far_right":      [ 5.0,  10.0, 0.0],
  "wall_top_near_left":   [-5.0, -10.0, 4.0],
  "wall_top_near_right":  [ 5.0, -10.0, 4.0],
  "wall_top_far_left":    [-5.0,  10.0, 4.0],
  "wall_top_far_right":   [ 5.0,  10.0, 4.0]
}

methodcourt.point()

Get a landmark

Returns the (X, Y) floor-level coordinates of a single named landmark.

Required arguments

  • Name
    name
    Type
    Landmark | str
    Description

    The landmark identifier. Accepts a Landmark enum member (e.g., Landmark.CENTER) or its string value (e.g., "center").

Keyword Arguments

  • Name
    coordinate_system
    Type
    CoordinateSystem
    Description

    The reference frame for the returned coordinates.

Returns

  • Name
    coordinates
    Type
    tuple[float, float]
    Description

    The (X, Y) position of the requested landmark.

Usage

method
point
from padelkit import PadelCourt, Landmark, CoordinateSystem

court = PadelCourt.fip_standard()

# Centered system (default)
center = court.point("center")

# Using enum member
net_left = court.point(Landmark.NET_LEFT)

# Corner-based system
center_cb = court.point(
    "center",
    CoordinateSystem.CORNER_BASED
)

Output

# court.point("center")
(0.0, 0.0)

# court.point("center", CoordinateSystem.CORNER_BASED)
(5.0, 10.0)

Was this page helpful?