Giter VIP home page Giter VIP logo

cubicbezier's People

Contributors

byorgey avatar finleymcilwaine avatar kaizhang avatar kuribas avatar lemmih avatar ryanglscott avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cubicbezier's Issues

No closest point found for a specific point and curve

In one of my algorithms I'm relying heavily on the closest function from the Geom2D.CubicBezier.Intersection module. Recently I've stumbled upon a specific use case in which no parameter t is found, which would mean there was no closest point for the supplied one (I find it to be slightly illogical).

The example data:

> let c = CubicBezier (Point 52.44 122.36) (Point 0 471.95) (Point 506.91 192.28) (Point 349.59 174.8)
> closest c (Point 319 171) 0.001
[]

I've made a fiddle to visualize this specific scenario: http://jsfiddle.net/2Xz6C/

Is there any explanation as to why this is happening? Can this be 'solved' by simply choosing the closest of the end points of the curve or is it more complicated than that?

Haddock build failure

Geom2D/CubicBezier/MetaPath.hs:71:23: error:
    parse error on input ‘-- ^ A metapath with endpoints’

Test suite compilation failure

Preprocessing test suite 'test' for cubicbezier-0.4.0.2...
[1 of 1] Compiling Main             ( tests/test.hs, dist/build/test/test-tmp/Main.o )

tests/test.hs:8:1: error:
    Failed to load interface for ‘MPTest’
    Use -v to see a list of the files searched for.

tests/test.hs:9:1: error:
    Failed to load interface for ‘NumTest’
    Use -v to see a list of the files searched for.

Build failure with matrices 0.5.0

Build failure as seen on the Stackage build server:

Geom2D/CubicBezier/Numeric.hs:218:20: error:
    Not in scope: ‘G.unsafeTakeRow’
    Perhaps you meant ‘V.unsafeTake’ (imported from Data.Vector.Unboxed)
    Module ‘Data.Matrix.Generic’ does not export ‘unsafeTakeRow’.
    |
218 |                   (G.unsafeTakeRow m i)
    |                    ^^^^^^^^^^^^^^^

I was able to reproduce this locally like so:

stack unpack cubicbezier-0.6.0.5 && cd cubicbezier-0.6.0.5
edit stack.yaml # add the following stack.yaml
stack build --test --bench --no-run-benchmarks --fast
# stack.yaml
resolver: nightly-2018-12-20
extra-deps:
- fast-math-1.0.2
- matrices-0.5.0

Compile failure with base<4.8

See failure below

I've already revised the meta-data of affected releases on Hackage as this was causing transitive failures in a few packages:


Configuring component lib from cubicbezier-0.6.0.2...
Preprocessing library cubicbezier-0.6.0.2...
[ 1 of 12] Compiling Math.BernsteinPoly ( Math/BernsteinPoly.hs, /tmp/matrix-worker/1493131754/dist-newstyle/build/x86_64-linux/ghc-7.8.4/cubicbezier-0.6.0.2/build/Math/BernsteinPoly.o )
[ 2 of 12] Compiling Geom2D.CubicBezier.Numeric ( Geom2D/CubicBezier/Numeric.hs, /tmp/matrix-worker/1493131754/dist-newstyle/build/x86_64-linux/ghc-7.8.4/cubicbezier-0.6.0.2/build/Geom2D/CubicBezier/Numeric.o )

Geom2D/CubicBezier/Numeric.hs:334:34: Warning:
    This binding for ‘rows’ shadows the existing binding
      imported from ‘Data.Matrix.Unboxed’ at Geom2D/CubicBezier/Numeric.hs:15:1-31
      (and originally defined in ‘Data.Matrix.Generic’)

Geom2D/CubicBezier/Numeric.hs:346:17: Warning:
    This binding for ‘rows’ shadows the existing binding
      imported from ‘Data.Matrix.Unboxed’ at Geom2D/CubicBezier/Numeric.hs:15:1-31
      (and originally defined in ‘Data.Matrix.Generic’)
[ 3 of 12] Compiling Geom2D           ( Geom2D.hs, /tmp/matrix-worker/1493131754/dist-newstyle/build/x86_64-linux/ghc-7.8.4/cubicbezier-0.6.0.2/build/Geom2D.o )

Geom2D.hs:21:33: Not in scope: type constructor or class ‘Foldable’

Geom2D.hs:21:43:
    Not in scope: type constructor or class ‘Traversable’

Geom2D.hs:37:32: Not in scope: type constructor or class ‘Foldable’

Geom2D.hs:37:42:
    Not in scope: type constructor or class ‘Traversable’

Geom2D.hs:40:42: Not in scope: type constructor or class ‘Foldable’

Geom2D.hs:40:52:
    Not in scope: type constructor or class ‘Traversable’

Geom2D.hs:43:45: Not in scope: type constructor or class ‘Foldable’

Geom2D.hs:43:55:
    Not in scope: type constructor or class ‘Traversable’

No output when points are separate by one unit of tolerance.

If two points are separated by one unit of tolerance on the Y-axis then 'union' will both consider them to be separate (in the X struct) /and/ overlapping. This leads to malformed curves in the output structure and the final output is an empty list.

lhs,rhs :: ClosedPath Double
lhc = ClosedPath
[(Point 2 0,JoinLine)
,(Point 4 3,JoinLine)
,(Point 0 3,JoinLine)]
rhs = ClosedPath
[(Point 2 0.1,JoinLine)
,(Point 6 1,JoinLine)
,(Point 6 3,JoinLine)
]

*Geom2D.CubicBezier.Overlap> union [lhs,rhs] NonZero 0.1
[]

This can be fixed by using (tolerance*2) when creating the X structure.

Build failures with mtl-2.3

Geom2D/CubicBezier/Overlap.lhs:279:5: error:
    • Variable not in scope:
        replicateM_
          :: Int
             -> SweepStateM ()
             -> StateT SweepState Data.Functor.Identity.Identity a0
    • Perhaps you meant ‘replicate’ (imported from Prelude)
    |
279 | >   replicateM_ nR (yStructDel i)
    |     ^^^^^^^^^^^

Geom2D/CubicBezier/Overlap.lhs:341:40: error:
    • Variable not in scope:
        liftM2
          :: (Ratio Integer -> Ratio Integer -> Ratio Integer)
             -> Maybe (Ratio Integer)
             -> Maybe (Ratio Integer)
             -> Maybe (Ratio Integer)
    • Perhaps you meant one of these:
        ‘lift’ (imported from Control.Monad.State.Strict),
        ‘liftIO’ (imported from Control.Monad.State.Strict)
    |
341 | >         | otherwise = set curveRank (liftM2 between
    |                                        ^^^^^^

Geom2D/CubicBezier/Overlap.lhs:547:5: error:
    Variable not in scope:
      unless
        :: Bool
           -> StateT SweepState Data.Functor.Identity.Identity ()
           -> StateT SweepState Data.Functor.Identity.Identity ()
    |
547 | >   unless (M.null xStr) $ do
    |     ^^^^^^

Geom2D/CubicBezier/Overlap.lhs:843:5: error:
    Variable not in scope:
      when
        :: Bool
           -> StateT SweepState Data.Functor.Identity.Identity ()
           -> StateT SweepState Data.Functor.Identity.Identity ()
    |
843 | >   when (i >= 0 && i < s-1) $
    |     ^^^^

The affected versions on Hackage are v0.4.0.1, v0.4.0.2, v0.5.0.0, v0.6.0.5 and v0.6.0.6.

As a Hackage trustee I have created Hackage revisions for the affected versions that should prevent users from encountering these errors. See e.g. https://hackage.haskell.org/package/cubicbezier-0.6.0.6/revisions/.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.