A Python library for geometric XML layout, panel intersection solving, and geometry generation.
- XML-based layout definition - Define complex panel layouts using declarative XML
- Intersection solving - Compute where panel centerlines meet (joints, T-junctions, crossings)
- Face segmentation - Determine how panel faces are subdivided by intersections
- Bounds computation - Calculate trim/gap adjustments for precise geometry
- Geometry generation - Create 3D panel geometry with proper mitering and gaps
pip install gxmlfromgxmlimportGXMLParserfromgxml.elements.solversimportIntersectionSolver, FaceSolver, BoundsSolver# Parse XML layoutparser=GXMLParser()
root=parser.parse_file("layout.xml")
# Extract panelspanels=root.get_panels()
# Solve geometryintersection_solution=IntersectionSolver.solve(panels)
face_result=FaceSolver.solve(intersection_solution)
bounds_solution=BoundsSolver.solve(face_result)
# Access computed geometryforpanelinpanels:
segments=bounds_solution.get_segments(panel, face_side)
corners=bounds_solution.get_face_corners(panel, face_side)The geometry pipeline has 4 stages:
- IntersectionSolver - Finds where panel centerlines meet
- FaceSolver - Determines face segmentation from intersection topology
- BoundsSolver - Computes trim/gap adjustments
- GeometryBuilder - Creates actual 3D geometry
Full documentation available at: https://github.com/yourusername/gxml/docs
# Clone repository
git clone https://github.com/yourusername/gxml.git
cd gxml
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate# Install with dev dependencies
pip install -e ".[dev]"# Run tests
pytestMIT License - see LICENSE file for details
Contributions welcome! Please read CONTRIBUTING.md for guidelines.