@ -1,4 +1,4 @@
|
||||
from typing import Any, Dict, List, Type, TypeVar, Union
|
||||
from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
||||
|
||||
import attr
|
||||
|
||||
@ -21,6 +21,7 @@ class line:
|
||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
end: Union[Unset, Point3d] = UNSET
|
||||
if not isinstance(self.end, Unset):
|
||||
end = self.end
|
||||
relative = self.relative
|
||||
@ -30,7 +31,8 @@ class line:
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({})
|
||||
if end is not UNSET:
|
||||
field_dict["end"] = end.to_dict()
|
||||
_end: Point3d = cast(Point3d, end)
|
||||
field_dict["end"] = _end.to_dict()
|
||||
if relative is not UNSET:
|
||||
field_dict["relative"] = relative
|
||||
field_dict["type"] = type
|
||||
@ -100,12 +102,15 @@ class arc:
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
angle_end = self.angle_end
|
||||
angle_start = self.angle_start
|
||||
center: Union[Unset, Point2d] = UNSET
|
||||
if not isinstance(self.center, Unset):
|
||||
center = self.center
|
||||
end: Union[Unset, Angle] = UNSET
|
||||
if not isinstance(self.end, Unset):
|
||||
end = self.end
|
||||
radius = self.radius
|
||||
relative = self.relative
|
||||
start: Union[Unset, Angle] = UNSET
|
||||
if not isinstance(self.start, Unset):
|
||||
start = self.start
|
||||
type = self.type
|
||||
@ -118,15 +123,18 @@ class arc:
|
||||
if angle_start is not UNSET:
|
||||
field_dict["angle_start"] = angle_start
|
||||
if center is not UNSET:
|
||||
field_dict["center"] = center.to_dict()
|
||||
_center: Point2d = cast(Point2d, center)
|
||||
field_dict["center"] = _center.to_dict()
|
||||
if end is not UNSET:
|
||||
field_dict["end"] = end.to_dict()
|
||||
_end: Angle = cast(Angle, end)
|
||||
field_dict["end"] = _end.to_dict()
|
||||
if radius is not UNSET:
|
||||
field_dict["radius"] = radius
|
||||
if relative is not UNSET:
|
||||
field_dict["relative"] = relative
|
||||
if start is not UNSET:
|
||||
field_dict["start"] = start.to_dict()
|
||||
_start: Angle = cast(Angle, start)
|
||||
field_dict["start"] = _start.to_dict()
|
||||
field_dict["type"] = type
|
||||
|
||||
return field_dict
|
||||
@ -218,10 +226,13 @@ class bezier:
|
||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
control1: Union[Unset, Point3d] = UNSET
|
||||
if not isinstance(self.control1, Unset):
|
||||
control1 = self.control1
|
||||
control2: Union[Unset, Point3d] = UNSET
|
||||
if not isinstance(self.control2, Unset):
|
||||
control2 = self.control2
|
||||
end: Union[Unset, Point3d] = UNSET
|
||||
if not isinstance(self.end, Unset):
|
||||
end = self.end
|
||||
relative = self.relative
|
||||
@ -231,11 +242,14 @@ class bezier:
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({})
|
||||
if control1 is not UNSET:
|
||||
field_dict["control1"] = control1.to_dict()
|
||||
_control1: Point3d = cast(Point3d, control1)
|
||||
field_dict["control1"] = _control1.to_dict()
|
||||
if control2 is not UNSET:
|
||||
field_dict["control2"] = control2.to_dict()
|
||||
_control2: Point3d = cast(Point3d, control2)
|
||||
field_dict["control2"] = _control2.to_dict()
|
||||
if end is not UNSET:
|
||||
field_dict["end"] = end.to_dict()
|
||||
_end: Point3d = cast(Point3d, end)
|
||||
field_dict["end"] = _end.to_dict()
|
||||
if relative is not UNSET:
|
||||
field_dict["relative"] = relative
|
||||
field_dict["type"] = type
|
||||
@ -318,6 +332,7 @@ class tangential_arc:
|
||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
offset: Union[Unset, Angle] = UNSET
|
||||
if not isinstance(self.offset, Unset):
|
||||
offset = self.offset
|
||||
radius = self.radius
|
||||
@ -327,7 +342,8 @@ class tangential_arc:
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({})
|
||||
if offset is not UNSET:
|
||||
field_dict["offset"] = offset.to_dict()
|
||||
_offset: Angle = cast(Angle, offset)
|
||||
field_dict["offset"] = _offset.to_dict()
|
||||
if radius is not UNSET:
|
||||
field_dict["radius"] = radius
|
||||
field_dict["type"] = type
|
||||
@ -390,8 +406,10 @@ class tangential_arc_to:
|
||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
angle_snap_increment: Union[Unset, Angle] = UNSET
|
||||
if not isinstance(self.angle_snap_increment, Unset):
|
||||
angle_snap_increment = self.angle_snap_increment
|
||||
to: Union[Unset, Point3d] = UNSET
|
||||
if not isinstance(self.to, Unset):
|
||||
to = self.to
|
||||
type = self.type
|
||||
@ -400,9 +418,11 @@ class tangential_arc_to:
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({})
|
||||
if angle_snap_increment is not UNSET:
|
||||
field_dict["angle_snap_increment"] = angle_snap_increment.to_dict()
|
||||
_angle_snap_increment: Angle = cast(Angle, angle_snap_increment)
|
||||
field_dict["angle_snap_increment"] = _angle_snap_increment.to_dict()
|
||||
if to is not UNSET:
|
||||
field_dict["to"] = to.to_dict()
|
||||
_to: Point3d = cast(Point3d, to)
|
||||
field_dict["to"] = _to.to_dict()
|
||||
field_dict["type"] = type
|
||||
|
||||
return field_dict
|
||||
|
Reference in New Issue
Block a user