Changes
4 changed files (+10/-291)
-
-
@@ -40,7 +40,6 @@ type alias LongPiece ={ length : Length , tip : TipShape , buckleHole : BuckleHole , flap : Length }
-
@@ -93,8 +92,6 @@ -}type alias ShortPiece = { length : Length , loops : Loops , caseSideFlap : Length , claspSideFlap : Length , buckle : Buckle }
-
@@ -189,7 +186,6 @@ , count = 7, interval = mm 6 , diameter = mm 2 } , flap = mm 15 } , shortPiece = { length = mm 80
-
@@ -199,8 +195,6 @@ , free = Just defaultFreeLoop, style = Simple , thickness = mm 1.0 } , caseSideFlap = mm 15 , claspSideFlap = mm 20 , buckle = { springBarDiameter = mm 1.4 } } , thickness = mm 2.5
-
-
-
@@ -39,30 +39,7 @@ (viewBox (String.join " " [ "0", "0", String.fromInt (ceiling canvasWidth), String.fromInt (ceiling canvasHeight) ]):: class "print" :: attrs ) [ defs [] [ pattern [ id "SkivingPattern" , x "0" , y "0" , width "3" , height "3" , patternUnits "userSpaceOnUse" ] [ Svg.path [ Svg.Path.d [ MoveTo Absolute ( -1, -1 ) , LineTo Absolute ( 4, 4 ) ] , fill "none" , stroke "currentColor" , strokeWidth "0.1" , strokeDasharray "1" ] [] ] ] , Container.rows [ Container.rows |> Container.sized (AtLeast 0) (AtLeast 0) |> Container.gapped 10 |> Container.aligned Container.Center
-
-
-
@@ -41,11 +41,7 @@ |> Container.build([ columns |> gapped (toMM params.rendering.gap) |> Container.build ([ surfacePieces params highlighting , linings params highlighting ] |> List.map noGrow ) [ surfacePieces params highlighting |> noGrow ] |> Just , loops params highlighting ]
-
@@ -72,22 +68,13 @@ , textAnchor "middle", dominantBaseline "hanging" , fill "currentColor" ] [ text ("Surfaces / t = " ++ (toMM params.thickness |> String.fromFloat) ++ "mm") ] [ text "Main pieces" ] ) , columns |> gapped (toMM params.rendering.gap) |> Container.build [ longPiece params highlighting, shortPiece params highlighting ] ] skivingSeamStroke : Parameters -> List (Svg.Attribute msg) skivingSeamStroke params = [ fill "none" , stroke "currentColor" , strokeWidth (toMM params.rendering.lineWidth |> String.fromFloat) , strokeDasharray "1 0.5" ] guideStroke : List (Svg.Attribute msg)
-
@@ -213,43 +200,17 @@ toMM params.lugWidthlength = toMM params.longPiece.length flap = toMM params.longPiece.flap in { size = { width = Exactly lugWidth, height = Exactly (length + flap) } { size = { width = Exactly lugWidth, height = Exactly length } , element = \p _ -> g [] (longPieceShape ( p.x, p.y + flap ) ( p.x, p.y ) params highlighting [ VerticalLineTo Relative -flap , HorizontalLineTo Relative -lugWidth , VerticalLineTo Relative flap , ClosePath ] :: Svg.path (Path.d [ MoveTo Absolute ( p.x, p.y + flap ) , HorizontalLineTo Relative lugWidth ] :: skivingSeamStroke params ) [] :: Svg.path [ Path.d [ MoveTo Absolute ( p.x, p.y ) , HorizontalLineTo Relative lugWidth , VerticalLineTo Relative flap , HorizontalLineTo Relative -lugWidth , ClosePath ] , fill "url(#SkivingPattern)" ] [] [ ClosePath ] :: (List.range 0 (params.longPiece.buckleHole.count - 1) |> List.map (\index ->
-
@@ -258,7 +219,7 @@ { buckleHole } =params.longPiece offset = toMM buckleHole.offset + flap toMM buckleHole.offset interval = toMM buckleHole.interval
-
@@ -327,15 +288,8 @@ ]] type alias ShortPieceOptions = { includeCaseSideFlap : Bool , includeClaspSideFlap : Bool , at : ( Float, Float ) } shortPieceShape : Parameters -> Maybe Key -> ShortPieceOptions -> Svg msg shortPieceShape params highlighting { includeCaseSideFlap, includeClaspSideFlap, at } = shortPieceShape : Parameters -> Maybe Key -> ( Float, Float ) -> Svg msg shortPieceShape params highlighting at = let lugWidth = toMM params.lugWidth
-
@@ -364,31 +318,11 @@ [][ Svg.path [ Path.d ([ Just (MoveTo Absolute ( x, y )) , if includeCaseSideFlap then Just (VerticalLineTo Relative (toMM params.shortPiece.caseSideFlap)) else Nothing , Just (LineTo Relative ( taper / 2, taperUntil )) , Just (VerticalLineTo Relative (length - taperUntil)) , if includeClaspSideFlap then Just (VerticalLineTo Relative (toMM params.shortPiece.claspSideFlap)) else Nothing , Just (HorizontalLineTo Relative (lugWidth - taper)) , if includeClaspSideFlap then Just (VerticalLineTo Relative -(toMM params.shortPiece.claspSideFlap)) else Nothing , Just (VerticalLineTo Relative -(length - taperUntil)) , Just (LineTo Relative ( taper / 2, -taperUntil )) , if includeCaseSideFlap then Just (VerticalLineTo Relative -(toMM params.shortPiece.caseSideFlap)) else Nothing , Just ClosePath ] |> List.filterMap identity
-
@@ -421,14 +355,6 @@ [], Svg.path (Path.d [ MoveTo Absolute ( x + lugWidth / 2, y ) , MoveTo Relative ( 0 , if includeCaseSideFlap then toMM params.shortPiece.caseSideFlap else 0 ) , VerticalLineTo Relative length ] :: highlightStroke (highlighting == Just ShortPieceLength)
-
@@ -443,14 +369,6 @@ Tapered _ ->Svg.path (Path.d [ MoveTo Absolute ( x + taper / 2, y + taperUntil ) , MoveTo Relative ( 0 , if includeCaseSideFlap then toMM params.shortPiece.caseSideFlap else 0 ) , HorizontalLineTo Relative (lugWidth - taper) ] :: guideStroke
-
@@ -465,151 +383,14 @@ letlugWidth = toMM params.lugWidth taper = case params.profile of Straight -> 0.0 Tapered to -> lugWidth - toMM to buckleWidth = lugWidth - taper length = toMM params.shortPiece.length caseSideFlap = toMM params.shortPiece.caseSideFlap claspSideFlap = toMM params.shortPiece.claspSideFlap in { size = { width = Exactly lugWidth, height = Exactly (length + caseSideFlap + claspSideFlap) } , element = \p _ -> g [] [ shortPieceShape params highlighting { includeCaseSideFlap = True , includeClaspSideFlap = True , at = ( p.x, p.y ) } , g (skivingSeamStroke params) [ Svg.path [ Path.d [ MoveTo Absolute ( p.x, p.y + caseSideFlap ) , HorizontalLineTo Relative lugWidth ] ] [] , Svg.path [ Path.d [ MoveTo Absolute ( p.x + taper / 2, p.y + caseSideFlap + length ) , HorizontalLineTo Relative buckleWidth ] ] [] ] , g [ fill "url(#SkivingPattern)" ] [ Svg.path [ Path.d [ MoveTo Absolute ( p.x, p.y ) , HorizontalLineTo Relative lugWidth , VerticalLineTo Relative caseSideFlap , HorizontalLineTo Relative -lugWidth , ClosePath ] ] [] , Svg.path [ Path.d [ MoveTo Absolute ( p.x + taper / 2, p.y + caseSideFlap + length ) , HorizontalLineTo Relative buckleWidth , VerticalLineTo Relative claspSideFlap , HorizontalLineTo Relative -buckleWidth , ClosePath ] ] [] ] ] } linings : Parameters -> Maybe Key -> Item msg linings params highlighting = rows |> aligned Container.Center |> gapped (toMM params.rendering.gap / 2) |> Container.build [ Item { width = Exactly 50, height = Exactly 5 } (\p size -> text_ [ x (String.fromFloat (p.x + size.width / 2)) , y (String.fromFloat p.y) , fontSize "5" , fontWeight "100" , textAnchor "middle" , dominantBaseline "hanging" , fill "currentColor" ] [ text ("Linings / t = " ++ (toMM params.lining |> String.fromFloat) ++ "mm") ] ) , columns |> gapped (toMM params.rendering.gap) |> Container.build [ longLining params highlighting, shortLining params highlighting ] ] longLining : Parameters -> Maybe Key -> Item msg longLining params highlighting = let lugWidth = toMM params.lugWidth length = toMM params.longPiece.length in { size = { width = Exactly lugWidth, height = Exactly length } , element = \p _ -> longPieceShape ( p.x, p.y ) params highlighting [ HorizontalLineTo Relative -lugWidth , ClosePath ] } shortLining : Parameters -> Maybe Key -> Item msg shortLining params highlighting = let lugWidth = toMM params.lugWidth length = toMM params.shortPiece.length in { size = { width = Exactly lugWidth, height = Exactly length } , element = \p _ -> shortPieceShape params highlighting { at = ( p.x, p.y ) , includeCaseSideFlap = False , includeClaspSideFlap = False } g [] [ shortPieceShape params highlighting ( p.x, p.y ) ] }
-
-
-
@@ -179,39 +179,6 @@ |> Container.build[ Item { width = Exactly 8, height = Exactly 5 } (\p size -> rect [ x (String.fromFloat p.x) , y (String.fromFloat p.y) , width (String.fromFloat size.width) , height (String.fromFloat size.height) , stroke "currentColor" , strokeWidth "0.2" , fill "url(#SkivingPattern)" ] [] ) , Item { width = Exactly 21, height = Exactly 4 } (\p size -> text_ [ x (String.fromFloat p.x) , y (String.fromFloat p.y) , fontSize (String.fromFloat size.height) , fontWeight "100" , textAnchor "left" , dominantBaseline "hanging" , fill "currentColor" ] [ text "Skiving area" ] ) ] , columns |> gapped 2 |> aligned Container.Center |> Container.build [ Item { width = Exactly 8, height = Exactly 5 } (\p size -> g [ fill "none" , stroke "currentColor"
-