HsYAML has GLPL licence apparently
hopefully this will also make the CI story easier
this can’t be right:
fromPointAndNormal _ n = NonVerticalHyperPlane n
we should really use the in plane point p
want:
- normalVector points into the positive halfspace
- onSideTest p
basically test that converting to a diff line type results in consistent results
https://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm
See if we can generalize its type signatures
most of the tests are uncommented. Not sure why
intersecting halflines with boxes seems to go wrong somehow.
initial run that actually triangulates the whole world:
cabal run hgeometry-examples:hgeometry-triangulateworld – -i -o 130.82s user 0.50s system 99% cpu 2:12.23 total
i.e. add a test that makes sure that the cyclic zero’s are correct, i.e. that
myPoly :: SimplePolygon (Point 2 R) myPoly = fromJust . fromPoints $ read @[Point 2 R] “[Point2 0 0,Point2 26 37.1,Point2 7.1 45.2,Point2 (-6.6) 39,Point2 (-1.9) 15.1,Point2 (-1.4) 12.7,Point2 0 0]”
sanitizes the two Point2 0 0’s at the end and the start
make sure we can report in which hole we are as well
(in particular, the arbitrary instances for polygon)
I wonder if we can clean up and/or speed up the fromVertexForm code by having a specific Set3 type that stores at least three elements. Since every vertex should have at least (and probably often also exactly) three definers, this could clean up some of the code. (We have a few “there should be at least three items here” cases).
Still not entirely sure that will help stufficiently though. Since we are sometimes relying on sorting etc, to be efficient.
e.g. if we have three definers, and we delete h from it (where h is guaranteed to appear: )
probably requires testing if two polygons are cyclic shifts
– I’m now guessing that the _Vector iso is causing the trouble, since that thing is potentially rebuilding a new vector (using generate) even if we are just accessing some field. If that is indeed happening, then that is very wasteful.
maybe make s.t. like prettychart; i.e have some webserver running that can show geometries as svg, and use ghci to start the server and send input to the server.
cabal v2-update ‘hackage.haskell.org,2022-12-29T17:16:17Z’
I compared the BAPC armybase tests. It’s a bit of an apples vs oranges comparison, since I only had an old 8.10.7 build of the bapc examples around, and I’ve built the new stuff using 9.6.1
anyway, the old bapc armybase testsuite took
13.65s user 0.03s system 99% cpu 13.687 total
whereas the new run took roughly
8.28s user 0.02s system 99% cpu 8.305 total
not sure what’s the mian gain. Maybe most of it is simply switching to a faster sorting algo; since we are now using vector-algorithms’s introsort rather than mergesort. > Still, it’s nice that we are faster :).