phetsims / kite

A library for creating, manipulating and displaying 2D shapes in JavaScript.
http://scenerystack.org/
MIT License
15 stars 6 forks source link

getStrokedShape leads to artifacts at certain corners #83

Open samreid opened 5 years ago

samreid commented 5 years ago

From https://github.com/phetsims/circuit-construction-kit-common/issues/537#issuecomment-558917786

Shape.getStrokedShape is leaving kinks at the corners, see the triangles at the junctions. Is this a shortcoming with Shape.getStrokedShape? Am I doing something wrong? Is there a way around it?

image

@jessegreenberg said:

That looks familiar I think I have seen that before - Are you passing a LineStyles to getStrokedShape? I think the lineCap and lineJoin used in capacitor-lab-basics WireShapeCreator are in part to remove similar artifacts.

I replied:

I still see an effect with round/round/7 (used in CLB)

image

@jessegreenberg said:

Jesse Greenberg 4:36 PM

Hmm, OK still looking - I have definitely seen that before but can't remember where yet I can't really find it [...] but I am seeing similar artifacts where lines join in energy-forms-and-changes in the burners:

image

Assigning to @jonathanolson for initial review, but I understand if this is not prioritized for near-term work.