C++ Computational Geometry Specialist - Medial Axis / Straight Skeleton Placement Engine
Publicada el 2026-07-29
Descripción de la oferta
I need a compact, well-tested C++ library that takes an SVG path representing a single letter and returns the medial axis, the centre line, of every stroke, ready for LED module placement. The core of the job is the straight skeleton computation, and I want it built on CGAL's straight skeleton rather than a Boost.Polygon Voronoi approach or any form of raster thinning. HOW IT SHOULD WORK - Parse the SVG outline, flatten curves to a configurable tolerance, and build the CGAL polygon with holes structure, then generate the interior straight skeleton. - From that skeleton, identify the centre line segments corresponding to each visible stroke. At corners, prune short or spurious branches. At junctions, split into distinct runs so no point is duplicated where strokes meet. - Along every resulting polyline, distribute points at a spacing supplied by the calling code, as a double in millimetres. Each point carries its local tangent so downstream code can orient an LED module without extra maths. DELIVERABLES 1. A C++17 library with minimal third party dependencies beyond CGAL and what CGAL itself requires. 2. A command line harness that reads an SVG file and a spacing value and prints point coordinates plus tangent vectors as JSON or plain text. Human readable either way. 3. Unit tests covering tricky glyphs, including joins, acute corners and holes, demonstrating clean pruning, correct splitting and zero duplicate placements. TUNABLE PARAMETERS The following must be exposed rather than hard coded, since they will need tuning against real output: - Branch pruning threshold, expressed as a fraction of local stroke width. Expect the useful range to sit near half the stroke width, not a token value. Anything much smaller leaves corner spurs in place. - Curve flattening tolerance. - Module spacing. ACCEPTANCE Primary test is visual. Output for a capital L, a capital M and an @ symbol, compared side by side against reference images I will supply to shortlisted candidates. The @ is included deliberately because it exercises curves, an inner spiral and a tail. Letters must look evenly laid out with no bunching or misaligned points at corners and junctions. Secondary checks: - Axis lies entirely inside the original outline. - No two generated points closer than 90 percent of the requested spacing. - Runtime under one second for a typical signage letter of roughly 1000 nodes. SCOPE Algorithm only. No GUI, no application boilerplate, no font loading, no cable routing, no power calculations. Just the geometry. HOW TO APPLY Please do not send a generic proposal. I will skip anything that does not answer this directly: In two or three sentences, how would you prevent the medial axis producing spurious branches at the corners of a letter?
Skills
Fuente original: freelancer