Menu

hatchcircle/rectangle/polygon not one object - bug?

2024-12-04
2024-12-06
  • John van Kemenade

    Hi again,

    I have another observation, where the output behaves in a different way than I expected.
    While circle, rectangle and polygon result in one single object on the reMarkable, the hatch-variants generate multiple objects: each stroke of the hatch is a separate object.

    This has been discovered while I was searching for a workaround because the reMarkable does not support the fill property.

    Can you please advice?

    Thanks in advance.

    John

     
    • A. Vontobel

      A. Vontobel - 2024-12-05

      I am not sure if it is even possible to implement. To my knowledge the rm lines format (version 5) does not support groups directly. It has lines consisting of multiple segments. If a shape is drawn with a single line it gets selected like an object. Hatches (for general shapes) cannot be drawn with a single line. Also I am not aware of a "lift pen" attribute for line segments. Thus I would not know how to create a single object for hatches.

      By the way. It would be an interesting task to develop an algorithm to fill shapes with strokes like you can do by hand. But it is quite tricky for general shapes. Anyone interested to contribute?

       
  • John van Kemenade

    This is how I solved filling shapes (not limited to circles though) with hatches - and yes I know, it draws quite some lines.....
    Tried to increase the pen width to limit the number of strokes, however I could not find a generic solution that filled the entire shape.

    proc fill.circle {x y radius fcolor} {
    if {= [strcmp $fcolor none] 0} {} else {
    set prevpen [pen $fcolor solid]
    hatch 45 [expr 0.75*[lindex $prevpen 2]]
    hatchcircle $x $y $radius
    pen $prevpen
    }
    circle $x $y $radius
    }

    As my contribution (the idea, don't know how to implement):
    the hatching algorithm is already capable of drawing a multitude of strokes. Therefore it is already computing start and endpoint. What if the hatching algorithm could tie the end point of a stroke to the start point of the next stroke. This will not in all cases result in a nicely filled shape (i.e. shapes with internal angles > 180* and a larger hatching distance), but it might work if the hatching distance is sufficiently small. Lifting the pen between end/start is better though :-)

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.