graphics - reconstructing a curve from its stroke -



graphics - reconstructing a curve from its stroke -

i trying reconstruct curves (pdf) graphics. these consist of outline of curve ("stroke"). typical illustration (monotonic in x, y increasing on hump , dropping) shown. original stroke-width appears 1.0, of secondary interest.

i include svg representation below. @ nowadays rather rough effort floodfill curve , effort lean until got midline. seems fragile. there improve algorithm given have analytical outline (as lines , cubic beziers?)

<svg xmlns="http://www.w3.org/2000/svg" > <g transform="scale(25., 25.)"> <g transform="translate(-110., -235.)"> <path fill="none" stroke="red" stroke-width=".05" d="m114.06 242.46 l114.12 242.28 l114.18 242.16 l114.3 242.04 c114.36 241.98 114.36 241.92 114.42 241.92 l114.48 241.86 c114.54 241.8 114.66 241.74 114.72 241.74 l114.78 241.74 c114.9 241.68 115.02 241.68 115.08 241.74 l115.2 241.8 c115.26 241.8 115.32 241.8 115.38 241.86 l115.44 241.92 l115.5 241.92 l115.2 241.86 l115.38 241.86 c115.44 241.86 115.5 241.86 115.56 241.86 l115.62 241.92 c115.74 241.92 115.8 241.92 115.86 241.98 l115.92 242.04 c115.98 242.04 116.04 242.1 116.1 242.22 l116.16 242.22 c116.16 242.28 116.16 242.34 116.22 242.4 l116.28 242.52 l116.34 242.7 l116.34 242.94 l116.4 243.18 l116.52 243.66 c116.58 244.02 116.34 244.32 116.04 244.44 c115.68 244.5 115.32 244.26 115.26 243.9 l115.2 243.48 l115.14 243.24 l115.08 243.06 l115.08 242.94 l115.02 242.82 l115.08 242.94 l115.02 242.88 l115.2 243.06 l115.14 243.0 l115.38 243.12 l115.26 243.12 l115.5 243.12 l115.2 243.12 c115.08 243.12 115.02 243.12 114.9 243.06 l114.78 242.94 l114.66 242.88 l114.84 243.0 l114.72 242.94 l115.08 242.94 l115.02 242.94 l115.26 242.88 l115.2 242.88 l115.32 242.76 l115.32 242.82 l115.2 243.0 c115.08 243.3 114.72 243.42 114.36 243.3 c114.06 243.18 113.94 242.82 114.06 242.46 z "/> </g> </g> </svg>

[answering own question since no comments or answers]

my best guess curve "drawn" "italic" pen normal direction of fundamental curve. here's roundedcaps version inkscape

my strategy now:

to find 2 curve segments alter direction 180 (i have code this) calculate diameter , utilize stroke width of original curve start 1 semicircle , extend along both lines leading off interpret lines (i) rectangle (ii) arc-left (iii) arc-right or (iv) arcs on both lines (trickier) repeat until components analysed

i don't know whether work i'm reasonably confident. shall write on plane journey fun.

graphics

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -