-
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
New stuff #218
New stuff #218
Conversation
Still needs a lot of work but it's a start.
Note that adjusting the diagram no longers converts measures to output. This still needs to be worked out.
Why not use cubicbezier directly? It would be easier for improvements and bugfixes. |
I thought about it. I wasn't sure about using |
I have used Double since I didn't think a typeclass would be necessary. But if using a typeclass makes it easier for diagrams, I can change it. |
However I wonder if for performance doing the conversion inside diagrams is better. Double precision should be good enough for any graphics need. Typeclasses will make the code slower. |
We do periodically run into precision issues with Double. For example: And some others on IRC. I'm not sure how conversion to and from Double would work for automatic differentiation or intervals. Surprisingly, I expect. I'm thrilled to have path intersection of any sort, but if it can be polymorphic, that's better. |
Well, many numerical issue aren't solved by throwing in more precision, but by chosing different formulas, avoiding castrophic cancelation. How would using a type class instead of Double improve numerical stability in my library? |
would the generality allow for using eg http://hackage.haskell.org/package/compensated-0.6.1 ? |
Not @kuribas I'm curious about boolean operations. Have you got any code yet? I'd like to see if diagrams could use it. |
@cchalmers the code for boolean operations and overlap removal isn't finished yet. But if you are interested I"ll work on it now. I don't see why diagrams couldn't use it... |
It's not just for higher precision numbers. Having native code makes it easier to integrate with other parts of diagrams. I also think it's kinda nice that all the geometry algorithms diagrams uses are in diagrams. I'm happy to port your code to diagrams so you can keep your module fast and I get learn how it works. We can still work together with bugs / improvements. I would be very grateful if you could finish your code on boolean operations. :) |
Cant we now get rid of GTAttributes, and the syb (actually the lens version) stuff, and Data constraints? |
Yes. I don't see any need for it any more. |
That's great, do you want to remove it and any constraints / packages dependencies. |
Doing it now :) |
…into new-stuff Conflicts: src/Diagrams/LinearMap.hs src/Diagrams/TwoD/Adjust.hs src/Diagrams/TwoD/Arrow.hs src/Diagrams/TwoD/Combinators.hs src/Diagrams/TwoD/Size.hs src/Diagrams/TwoD/Text.hs
Looks like I was a bit ambitious to try to do everything in one PR. It ended up being a lot more than I first thought. I'll split up intersections and projections in another request so just ignore them for now. The rest of it is almost ready to merge. I'm pretty happy with how 'Measure' turned out. It's simpler on the backends and there's no more 'Data' constraints. I think I'll also be turn a 'Measured (Diagram B)' into a delayed leaf which I'll work on next. The changes to 'SizeSpec' are almost done. Please have a look at it, I'm open to any suggestions on it. There's also lots of changes with cleaning up type signatures with 'InSpace'. |
I'm happy with the way |
…into new-stuff
…into new-stuff
There's probably a few bugs still loitering around but I'd like to merge this if there's no objections? |
Agreed, I assume you want to merge all of the new-stuff branches? |
Yes. We can still merge Cairo, I just haven't tested if the text is scaled properly. |
I am currently reading "Numerical methods" by Richard Hamming. I think part one is an excellent introduction to floating point and rounding issues. Also it's a dover publication, so it's cheap :-) |
Not ready to merge.
New Measure changes
lineWidth
anddashing
attributes are no longer tied toV2
so they're moved to 'Diagrams.Attributes'Text
is now wrapped inScaleInv
and gets scaled fromFontSize
by backends.Generalised SizeSpec
Diagrams.Size
SizeSpec v n
is now a wrapper overv n
SizeSpec
returnsv (Maybe n)
with only strictly positive valuesDiagrams.TwoD.Size
has some specialised functions.Intersections (unfinished)
cubicbezier
package) and linear-linear using linear interpolation.Projections (unfinished)
Path
(projecting aDiagram
would need special a backend)LinearMap v u n
used for orthogonal projectionsDeformable v u n
used for perspective projections