Skip to content
This diff is collapsed.
...@@ -22,3 +22,13 @@ ...@@ -22,3 +22,13 @@
implements standard primitives like line, segment and Bezier curve. implements standard primitives like line, segment and Bezier curve.
""" """
####################################################################################################
from .Primitive import Primitive2DMixin
from .Vector import Vector2D
####################################################################################################
# Fixme: to fix cyclic import issue
Primitive2DMixin.__vector_cls__ = Vector2D
This diff is collapsed.
This diff is collapsed.
...@@ -83,6 +83,14 @@ class PaperSize: ...@@ -83,6 +83,14 @@ class PaperSize:
def width(self): def width(self):
return self._width return self._width
@property
def height_in(self):
return self._height / 25.4
@property
def width_in(self):
return self._width / 25.4
@property @property
def margin(self): def margin(self):
return self._margin return self._margin
This diff is collapsed.
This diff is collapsed.
...@@ -72,7 +72,7 @@ class TexPainter(Painter): ...@@ -72,7 +72,7 @@ class TexPainter(Painter):
def __init__(self, path, scene, paper): def __init__(self, path, scene, paper):
super(TexPainter, self).__init__(scene) super().__init__(scene)
self._document = Document(path, 'article', '12pt') self._document = Document(path, 'article', '12pt')
self._paper = paper self._paper = paper
......
...@@ -36,12 +36,12 @@ class TikzFigure(Environment): ...@@ -36,12 +36,12 @@ class TikzFigure(Environment):
'none': None, 'none': None,
'solid': 'solid', 'solid': 'solid',
} }
__COLOR__ = { __COLOR__ = {
None : None, None : None,
'black': 'black', 'black': 'black',
} }
@staticmethod @staticmethod
def format_path_style(path_syle): def format_path_style(path_syle):
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -564,7 +564,7 @@ class NormalPoint(Point, LinePropertiesMixin, FirstSecondPointMixin, LengthAngle ...@@ -564,7 +564,7 @@ class NormalPoint(Point, LinePropertiesMixin, FirstSecondPointMixin, LengthAngle
vector = self._second_point.vector - self._first_point.vector vector = self._second_point.vector - self._first_point.vector
self._pattern.calculator.set_current_segment(vector) self._pattern.calculator.set_current_segment(vector)
direction = vector.to_normalised() direction = vector.to_normalised()
direction = direction.normal() direction = direction.normal
angle = self._angle.value angle = self._angle.value
if angle: if angle:
direction = direction.rotate(angle) direction = direction.rotate(angle)
......
...@@ -168,10 +168,10 @@ class Calculator: ...@@ -168,10 +168,10 @@ class Calculator:
def _function_AngleLine(self, point_name1, point_name2): def _function_AngleLine(self, point_name1, point_name2):
point1, point2 = self._names_to_vector_points(point_name1, point_name2) point1, point2 = self._names_to_vector_points(point_name1, point_name2)
return (point2 - point1).orientation() return (point2 - point1).orientation
def _function_CurrentLength(self): def _function_CurrentLength(self):
return self._current_segment.magnitude() return self._current_segment.magnitude
def _function_C1LengthSpl(self, point_name1, point_name2): def _function_C1LengthSpl(self, point_name1, point_name2):
point1, point2 = self._names_to_vector_points(point_name1, point_name2) point1, point2 = self._names_to_vector_points(point_name1, point_name2)
...@@ -183,7 +183,7 @@ class Calculator: ...@@ -183,7 +183,7 @@ class Calculator:
def _function_Line(self, point_name1, point_name2): def _function_Line(self, point_name1, point_name2):
point1, point2 = self._names_to_vector_points(point_name1, point_name2) point1, point2 = self._names_to_vector_points(point_name1, point_name2)
return (point2 - point1).magnitude() return (point2 - point1).magnitude
def _function_Spl(self, point_name1, point_name2): def _function_Spl(self, point_name1, point_name2):
point1, point2 = self._names_to_vector_points(point_name1, point_name2) point1, point2 = self._names_to_vector_points(point_name1, point_name2)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.