Read Elements

class GGBElementType(*values)

Bases: Enum

POINT = 'point'
LINE = 'line'
CONIC = 'conic'
SEGMENT = 'segment'
class GGBPoint(**data)

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

type: Literal[<GGBElementType.POINT: 'point'>]
label: str
x: float
y: float
z: float
classmethod from_xml_element(element)
Return type:

GGBPoint

to_newclid()
Return type:

Point

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class GGBLine(**data)

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

type: Literal[<GGBElementType.LINE: 'line'>]
line_name: str
points: list[str]
classmethod from_xml_element(element)
Return type:

GGBLine

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class GGBConic(**data)

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

type: Literal[<GGBElementType.CONIC: 'conic'>]
conic_name: str
points: list[str]
center: str | None
radius: str | tuple[str, str] | None
classmethod from_xml_element(element)
Return type:

GGBConic

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

read_elements(root)
Return type:

tuple[dict[str, GGBPoint], dict[str, GGBLine], dict[str, GGBConic]]