How fabricesalvaire/patro works
Patro is a Python library for fashion pattern drafting. Its principal workflow is to define measurements and sketch operations, calculate dependent values, represent the result with geometric primitives, and place those primitives in a graphic scene for rendering or export. The tree also shows Valentina, SVG, and DXF format support and several painter backends; their detailed runtime wiring is not established by the sampled excerpts, so those links are marked unverified or omitted.
Main entry points: GraphicItem.py Graphic items · SketchOperation.py Sketch operations · Scene.py Graphic scene · Path.py Curves and paths
Components 29
Pattern drafting
- Pattern sketch
Patro/Pattern/Sketch.py - Sketch operations
Patro/Pattern/SketchOperation.py - Expression calculator
Patro/Pattern/Calculator.py - Pattern model
Patro/Pattern/Pattern.py
Geometry engine
- Geometric primitives
Patro/GeometryEngine/Primitive.py - Vectors and transforms
Patro/GeometryEngine/Vector.py - Curves and paths
Patro/GeometryEngine/Path.py - Bezier curves
Patro/GeometryEngine/Bezier.py - Conics
Patro/GeometryEngine/Conic.py - Segments and lines
Patro/GeometryEngine/Segment.py - Polygons
Patro/GeometryEngine/Polygon.py
Graphics and painters
- Graphic scene
Patro/GraphicEngine/GraphicScene/Scene.py - Graphic items
Patro/GraphicEngine/GraphicScene/GraphicItem.py - Graphic styles
Patro/GraphicStyle/__init__.py - Qt application
Patro/QtApplication/QmlApplication.py - Qt painter
Patro/GraphicEngine/Painter/QtPainter.py - Other painters
Patro/GraphicEngine/Painter
Formats and measurements
- Body measurements
Patro/Measurement/Measurement.py - Valentina measurements
Patro/FileFormat/Valentina/Measurement.py - Valentina pattern format
Patro/FileFormat/Valentina/Pattern.py - VIT format
Patro/FileFormat/Valentina/VitFormat.py - SVG format
Patro/FileFormat/Svg/SvgFormat.py - SVG file I/O
Patro/FileFormat/Svg/SvgFile.py - DXF importer
Patro/FileFormat/Dxf/Importer.py - DXF polylines
Patro/FileFormat/Dxf/Polyline.py - Textile technology
Patro/TextileTechnology
Shared utilities
- Math helpers
Patro/Common/Math/Functions.py - Dependency graph
Patro/Common/Graph/DirectedAcyclicGraph.py
Other components
- Pattern designer
Connections 32
- Pattern designer → Pattern sketch: defines sketch
- Pattern sketch → Sketch operations: organizes operations
- Sketch operations → Expression calculator: evaluates expressions
Patro/Pattern/SketchOperation.py - Sketch operations → Dependency graph: registers dependencies
Patro/Pattern/SketchOperation.py - Body measurements → Pattern sketch: supplies inputs
- Valentina measurements → Body measurements: imports data
- Valentina pattern format → Pattern sketch: loads pattern
- VIT format → Sketch operations: reads operations
Patro/FileFormat/Valentina/VitFormat.py - Sketch operations → Geometric primitives: constructs geometry
- Geometric primitives → Vectors and transforms: uses vectors
Patro/GeometryEngine/Vector.py - Curves and paths → Bezier curves: uses curves
Patro/GeometryEngine/Path.py - Curves and paths → Conics: uses conics
Patro/GeometryEngine/Path.py - Segments and lines → Geometric primitives: extends primitives
Patro/GeometryEngine/Segment.py - Polygons → Segments and lines: builds edges
Patro/GeometryEngine/Polygon.py - Graphic scene → Graphic items: creates items
Patro/GraphicEngine/GraphicScene/Scene.py - Graphic scene → Curves and paths: accepts paths
Patro/GraphicEngine/GraphicScene/Scene.py - Graphic scene → Polygons: accepts polygons
Patro/GraphicEngine/GraphicScene/Scene.py - Graphic items → Bezier curves: handles curves
Patro/GraphicEngine/GraphicScene/GraphicItem.py - Graphic items → Conics: handles conics
Patro/GraphicEngine/GraphicScene/GraphicItem.py - Graphic items → Curves and paths: handles paths
Patro/GraphicEngine/GraphicScene/GraphicItem.py - Qt application → Qt painter: configures painter
Patro/QtApplication/QmlApplication.py - Qt painter → Graphic scene: renders scene
Patro/GraphicEngine/Painter/QtPainter.py - Qt painter → Graphic items: renders items
Patro/GraphicEngine/Painter/QtPainter.py - Graphic items → Graphic styles: uses styles
- Other painters → Graphic scene: renders scene
Patro/GraphicEngine/Painter/QtPainter.py - SVG format → Curves and paths: converts paths
Patro/FileFormat/Svg/SvgFormat.py - SVG file I/O → SVG format: reads and writes
- DXF importer → DXF polylines: imports polylines
- DXF polylines → Segments and lines: uses segments
Patro/FileFormat/Dxf/Polyline.py - DXF polylines → Conics: uses conics
Patro/FileFormat/Dxf/Polyline.py - VIT format → Vectors and transforms: uses vectors
Patro/FileFormat/Valentina/VitFormat.py - Vectors and transforms → Math helpers: uses helpers
Patro/GeometryEngine/Vector.py