Skip to content
This diff is collapsed.
......@@ -22,3 +22,13 @@
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:
def width(self):
return self._width
@property
def height_in(self):
return self._height / 25.4
@property
def width_in(self):
return self._width / 25.4
@property
def margin(self):
return self._margin
This diff is collapsed.
This diff is collapsed.
......@@ -72,7 +72,7 @@ class TexPainter(Painter):
def __init__(self, path, scene, paper):
super(TexPainter, self).__init__(scene)
super().__init__(scene)
self._document = Document(path, 'article', '12pt')
self._paper = paper
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -564,7 +564,7 @@ class NormalPoint(Point, LinePropertiesMixin, FirstSecondPointMixin, LengthAngle
vector = self._second_point.vector - self._first_point.vector
self._pattern.calculator.set_current_segment(vector)
direction = vector.to_normalised()
direction = direction.normal()
direction = direction.normal
angle = self._angle.value
if angle:
direction = direction.rotate(angle)
......
......@@ -168,10 +168,10 @@ class Calculator:
def _function_AngleLine(self, 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):
return self._current_segment.magnitude()
return self._current_segment.magnitude
def _function_C1LengthSpl(self, point_name1, point_name2):
point1, point2 = self._names_to_vector_points(point_name1, point_name2)
......@@ -183,7 +183,7 @@ class Calculator:
def _function_Line(self, 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):
point1, point2 = self._names_to_vector_points(point_name1, point_name2)
......
......@@ -135,13 +135,15 @@ class Pattern:
##############################################
@property
def bounding_box(self):
"""Compute the bounding box of the pattern."""
bounding_box = None
for calculation in self._calculations:
interval = calculation.geometry().bounding_box()
interval = calculation.geometry().bounding_box
print(calculation.geometry(), interval)
if bounding_box is None:
bounding_box = interval
else:
......@@ -167,7 +169,7 @@ class Pattern:
scene = GraphicScene()
# Fixme: scene bounding box
scene.bounding_box = self.bounding_box()
scene.bounding_box = self.bounding_box
# Fixme: implement a transformer class to prevent if ... ?
......
......@@ -390,7 +390,7 @@ ul.auto-toc {
<h1>Overview</h1>
<div class="section" id="what-is-patro">
<h2>What is Patro ?</h2>
<p>Patro is a Python module which implements pattern drafting for fashion design.</p>
<p>Patro is a Python library which implements pattern drafting for fashion design.</p>
</div>
<div class="section" id="where-is-the-documentation">
<h2>Where is the Documentation ?</h2>
......@@ -398,21 +398,7 @@ ul.auto-toc {
</div>
<div class="section" id="what-are-the-main-features">
<h2>What are the main features ?</h2>
<!-- -*- Mode: rst -*- -->
<p>The features of Patro are :</p>
<ul class="simple">
<li>read/write <em>.val</em> and <em>.vit</em> file</li>
<li><a class="reference external" href="http://beltoforion.de/article.php?a=muparser">QMuParser</a> expressions are translated to Python and evaluated on the fly</li>
<li>API to define patterns</li>
<li>compute the detail of a pattern</li>
<li>export the detail to latex/pgf as A0 or tiled A4 paper</li>
</ul>
<p>Missing features:</p>
<ul class="simple">
<li>full operation support</li>
<li>direct PDF export</li>
<li>SVG export</li>
</ul>
<!-- .. include:: features.txt -->
<img alt="https://raw.github.com/FabriceSalvaire/Patro/master/test/output/pattern-a0.png" src="https://raw.github.com/FabriceSalvaire/Patro/master/test/output/pattern-a0.png" style="height: 600px;" />
<img alt="https://raw.github.com/FabriceSalvaire/Patro/master/test/output/pattern-a4.png" src="https://raw.github.com/FabriceSalvaire/Patro/master/test/output/pattern-a4.png" style="height: 600px;" />
</div>
......
This diff is collapsed.