-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arrow misses target #126
Comments
Hmm, yes, that is a bit off, isn't it? Can you post the code you used to generate this image? |
Also, do you get the correct image if you use the iterative version of |
Yes I do get the correct image with the iterative version. Code is below. |
{-# LANGUAGE NoMonomorphismRestriction #-}
-----------------------------------------------------------------------------
-- |
-- Module : Diagrams.TwoD.Arrowtest
-- Copyright : (c) 2013 diagrams-lib team (see LICENSE)
-- License : BSD-style (see LICENSE)
-- Maintainer : diagrams-discuss@googlegroups.com
--
-- Test module for Arrow.hs and Arrowheads.hs
--
-----------------------------------------------------------------------------
module Main where
import Diagrams.Prelude
import Diagrams.Backend.SVG
import Diagrams.Backend.SVG.CmdLine
import Control.Lens ((.~), (&), (%~))
-- | example 0 ------------------------------------------------------------
example = d # connect' (with & arrowHead .~ arrowheadSpike (7/16 :: Turn)
& arrowTail .~ noTail
& headSize .~ 2 & headStyle %~ fc green
& arrowShaft .~ s
& shaftStyle %~ lw 0.1 # fc blue)
"1" "2"
where
c = circle 1.5 # showOrigin # lw 0.02
t = bezier3 (r2 (1,1)) (r2 (1,1)) (r2 (0,2))
t' = reflectX t
l = straight unitX
l' = straight (unitX # rotateBy (1/6))
s = trailFromSegments [t, l, t', l, t]
x |-| y = x ||| strutX 2 ||| y
row1 = (c # named "1") |-| (c # named "2")
d = row1
main = defaultMain $ ( example # centerXY) # pad 1.1
|
As far as I can tell from looking at the svg, some of the control points on the arrow shaft differ by almost 10%, e.g. 0.66 vs 0.60 between the algebraic and iterative versions. |
Fixes #126. I hope. Also removes startTangent and endTangent in favor of the new machinery in Diagrams.Tangent.
When using a large head size and curvy shaft the head does not point directly at the oriign.
Apparently this has to do with the shaftScale function
The text was updated successfully, but these errors were encountered: