Initial Comment:
- create a text string
- convert to path
- inset or outset
The path disappears (no d="" attribute).
fixed that for outlines (SP_IS_PATH() is true for text, i wasn't expecting it), i'll change the .._do_offset() function later (it's a minor change)
Indeed "stroke to path" (i.e. outline) now works for objects from a text string, but inset/outset segfaults for them :(
Initial Comment: When insetting or outsetting a shape repeatedly, it loses fill and stroke (gets fill:none;stroke:none) after the second inset/outset. On the first inset/outset, it sometimes becomes black. Fill and stroke must be preserved in inset/outset operations.
losing the stroke is intended: if you have a path, and want a polygon representing the stroke, that new polygon has no stroke, just a fill. so the function sets stroke to none and fill to the stroke of the original path. outlining a second time should will have the fill none since it will be copied from stroke. maybe i should prevent outlining if stroke is none? or use another behavior?
What you describe is correct for the "stroke to path" (i.e. outline), but I was speaking about inset/outset. These operations should of course preserve fill and stroke.
algorithm. Now simplification preserves the shape very closely, and it does not always result in reducing the number of nodes. For example draw a freehand line and then simplify it - on the first step, the number of nodes usually increases! On subsequent simplifications, it decreases back, but not to the original number, and after some time the path becomes "stable" and is not simplified further. I would like a command that guarantees to remove at least one node on each application, and may distort the shape to achieve that (but tries to keep distortion to the minimum).
distortion is the problem here. when simplifying the outline stroke of very thin strokes (like a 1 pixel wide stroke), distortion becomes very visible, so the treshholds depend on the stroke width now. if you want to apply it to arbitrary path, you need a way to specify the treshholds (which are sort of the maximum distance from a point to the approximated curve). note that the sp_selected_path_cleanup() does not use the bezier fitter in helper/bezier-utils.c, but simply merges the subpaths when possible; it's far less agressive than sp_selected_path_simplify(). at any rate, i dunno what to do here, except removing sp_path_selected_simplify() altogether...
No, don't delete it :) I will experiment with different threshold values to find a value more suitable for standalone application of the command. As for using simplify with inset/outset, the dependence on the stroke width is of course correct, no need to change that.
regarding the errors in outline (d="", irregularities), can you send me SVG samples?
Will do, later today.
_________________________________________________________________ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=http%3a%2f%2f...