hdrvars.py 562 B

1234567891011121314151617181920
  1. # Purpose: header variables factory
  2. # Created: 20.11.2010
  3. # Copyright (c) 2010-2018, Manfred Moitzi
  4. # License: MIT License
  5. from typing import Sequence, Union
  6. from .types import DXFVertex, DXFTag, cast_tag_value
  7. def SingleValue(value: Union[str, float], code: int = 1) -> DXFTag:
  8. return DXFTag(code, cast_tag_value(code, value))
  9. def Point2D(value: Sequence[float]) -> DXFVertex:
  10. return DXFVertex(10, (value[0], value[1]))
  11. def Point3D(value: Sequence[float]) -> DXFVertex:
  12. return DXFVertex(10, (value[0], value[1], value[2]))