implicit 0.3.0.0 → 0.3.0.1
raw patch · 7 files changed
+18/−18 lines, 7 files
Files
- Graphics/Implicit/Export/NormedTriangleMeshFormats.hs +5/−5
- Graphics/Implicit/Export/Render.hs +1/−1
- Graphics/Implicit/Export/TriangleMeshFormats.hs +1/−1
- Graphics/Implicit/ExtOpenScad/Parser/Expr.hs +5/−5
- Graphics/Implicit/ExtOpenScad/Primitives.hs +3/−3
- implicit.cabal +2/−2
- programs/extopenscad.hs +1/−1
Graphics/Implicit/Export/NormedTriangleMeshFormats.hs view
@@ -26,15 +26,15 @@ n :: ℝ3 -> Builder n (x,y,z) = "vn " <> bf x <> " " <> bf y <> " " <> bf z <> "\n" verts = do- -- | Extract the vertices for each triangle- -- recall that a normed triangle is of the form ((vert, norm), ...)+ -- Extract the vertices for each triangle.+ -- recall that a normed triangle is of the form ((vert, norm), ...) NormedTriangle ((a,_),(b,_),(c,_)) <- normedtriangles- -- | The vertices from each triangle take up 3 positions in the resulting list+ -- The vertices from each triangle take up 3 positions in the resulting list [a,b,c] norms = do- -- | extract the normals for each triangle+ -- extract the normals for each triangle NormedTriangle ((_,a),(_,b),(_,c)) <- normedtriangles- -- | The normals from each triangle take up 3 positions in the resulting list+ -- The normals from each triangle take up 3 positions in the resulting list [a,b,c] vertcode = foldMap v verts normcode = foldMap n norms
Graphics/Implicit/Export/Render.hs view
@@ -233,7 +233,7 @@ ]| y0<-pYs | y1'<-tail pYs |mX'' <-midsX | mX'T <-tail midsX | mY'' <-midsY | objY0 <- objV | objY1 <- tail objV ] `using` parBuffer (max 1 $ div (fromℕ $ nx+ny) forcesteps) rdeepseq in- -- | Merge squares, etc+ -- Merge squares cleanLoopsFromSegs . fold $ fold segs -- utility functions
Graphics/Implicit/Export/TriangleMeshFormats.hs view
@@ -52,7 +52,7 @@ zsame :: Eq a => ((a, a, a), (a, a, a), (a, a, a)) -> Bool zsame ((_,_,z1),(_,_,z2),(_,_,z3)) = same (z1, z2, z3) isDegenerateTri :: Triangle -> Bool- isDegenerateTri (Triangle (a, b, c)) = isDegenerateTri2Axis floatTri -- || (isDegenerateTriLine $ floatTri) || (isDegenerateTriPoint $ floatTri)+ isDegenerateTri (Triangle (a, b, c)) = isDegenerateTri2Axis floatTri where floatTri = (floatPoint a, floatPoint b, floatPoint c) in TriangleMesh $ filter (not . isDegenerateTri) (unmesh tris)
Graphics/Implicit/ExtOpenScad/Parser/Expr.hs view
@@ -51,9 +51,9 @@ pure $ Var "?" :$ [condition, trueExpr, falseExpr] <|> pure condition- , \higher -> -- || boolean OR operator+ , \higher -> -- boolean OR operator (||) chainl1 higher $ binaryOperation <$> matchOR- , \higher -> -- && boolean AND operator+ , \higher -> -- boolean AND operator (&&) chainl1 higher $ binaryOperation <$> matchAND , \higher -> -- == and != operators chainl1 higher $ binaryOperation <$> (matchEQ <|> matchNE)@@ -61,11 +61,11 @@ chainl1 higher $ binaryOperation <$> (matchLE <|> matchLT <|> matchGE <|> matchGT) , \higher -> -- + and - operators chainl1 higher $ binaryOperation . pure <$> oneOf "+-" <* whiteSpace- , \higher -> -- ++ string/list concatenation operator. This is not available in OpenSCAD.+ , \higher -> -- string/list concatenation operator (++). This is not available in OpenSCAD. chainl1 higher $ binaryOperation <$> matchCAT- , \higher -> -- ^ exponent operator. This is not available in OpenSCAD.+ , \higher -> -- exponent operator (^). This is not available in OpenSCAD. chainr1 higher $ binaryOperation <$> matchTok '^'- , \higher -> -- *, /, % operators+ , \higher -> -- multiplication (*), division (/), and modulus (%) operators chainl1 higher $ binaryOperation . pure <$> oneOf "*/%" <* whiteSpace , \higher -> fix $ \self -> -- unary ! operator. OpenSCAD's YACC parser puts '!' at the same level of precedence as '-' and '+'.
Graphics/Implicit/ExtOpenScad/Primitives.hs view
@@ -310,9 +310,9 @@ d2d3 = distanceSq p2 p3 isGridAligned :: ℝ2 -> ℝ2 -> Bool isGridAligned (x1, y1) (x2, y2) = x1 == x2 || y1 == y2- -- | Rectangles have no overlapping points,- -- the distance on each side is equal to it's opposing side,- -- and the distance between the pairs of opposing corners are equal.+ -- Rectangles have no overlapping points,+ -- the distance on each side is equal to it's opposing side,+ -- and the distance between the pairs of opposing corners are equal. in if (p1 /= p2 && p2 /= p3 && p3 /= p4 && p4 /= p1) && (d1d2==d3d4 && d1d3==d2d4) && (d1d4==d2d3) && isGridAligned p1 p2
implicit.cabal view
@@ -1,9 +1,9 @@ Name: implicit-Version: 0.3.0.0+Version: 0.3.0.1 Cabal-version: >= 1.10 Tested-with: GHC >= 8.6 Build-type: Simple-Synopsis: A math-inspired programmatic 2&3D CAD system.+Synopsis: A math-inspired programmatic 2D & 3D CAD system. Description: An OpenSCAD execution engine for generating models in STL and many other formats. License: AGPL-3 License-file: LICENSE
programs/extopenscad.hs view
@@ -350,7 +350,7 @@ else putStrLn "No objects to render." _ -> hPutStr stderr "ERROR: File contains a mixture of 2D and 3D objects, what do you want to render?\n" - -- | Always display our warnings, errors, and other non-textout messages on stderr.+ -- Always display our warnings, errors, and other non-textout messages on stderr. hPutStr stderr $ unlines $ show <$> filter (not . isTextOut) messages let textOutHandler =