Changes
6 changed files (+7/-163)
-
-
@@ -81,18 +81,10 @@ , thickness : Length} type alias BuckleTongue = { thickness : Length , width : Length } {-| Clasp / Buckle. -} type alias Buckle = { springBarDiameter : Length , tongue : Maybe BuckleTongue } { springBarDiameter : Length } {-| Parameters for the short piece, which has clasp at the end.
-
@@ -170,13 +162,6 @@ , overlap = mm 5} defaultBuckleTongue : BuckleTongue defaultBuckleTongue = { thickness = mm 2 , width = mm 2.6 } default : Parameters default = { lugWidth = mm 20
-
@@ -201,10 +186,7 @@ , thickness = mm 1.0} , caseSideFlap = mm 15 , claspSideFlap = mm 20 , buckle = { springBarDiameter = mm 1.4 , tongue = Just defaultBuckleTongue } , buckle = { springBarDiameter = mm 1.4 } } , thickness = mm 2.5 , lining = mm 0.5
-
@@ -281,17 +263,6 @@ Nothing ->[] ) |> (++) (case params.shortPiece.buckle.tongue of Just tongue -> [ ( Key.toString HasBuckleTongue, "" ) , ( Key.toString BuckleTongueThickness, String.fromFloat (toMM tongue.thickness) ) , ( Key.toString BuckleTongueWidth, String.fromFloat (toMM tongue.width) ) ] Nothing -> [] ) |> (++) (if params.rendering.qrCode then [ ( Key.toString QRCode, "" ) ]
-
@@ -312,8 +283,6 @@ , ( Key.toString FixedLoopPlay, String.fromFloat (toMM defaultFixedLoop.play) ), ( Key.toString FreeLoopWidth, String.fromFloat (toMM defaultFreeLoop.width) ) , ( Key.toString FreeLoopPlay, String.fromFloat (toMM defaultFreeLoop.play) ) , ( Key.toString FreeLoopOverlap, String.fromFloat (toMM defaultFreeLoop.overlap) ) , ( Key.toString BuckleTongueThickness, String.fromFloat (toMM defaultBuckleTongue.thickness) ) , ( Key.toString BuckleTongueWidth, String.fromFloat (toMM defaultBuckleTongue.width) ) , ( Key.toString BuckleHoleDiameter, String.fromFloat (toMM default.longPiece.buckleHole.diameter) ) ] |> Dict.fromList
-
-
-
@@ -643,44 +643,6 @@ , disabled = False, attrs = step "0.1" :: lengthFieldAttrs constraints.shortPiece.buckle.springBarDiameter } , boolField model { key = HasBuckleTongue , title = [ text "Buckle Tongue Cutout" ] , description = [ text "Whether to draw cutout for buckle tongue." ] , attrs = [] , disabled = False , true = { label = [ text "Enabled" ] , description = [ text "Draw cutout at where buckle tongue sits on." ] } , false = { label = [ text "Disabled" ] , description = [ text "Do not draw cutout for buckle tongue. " , text "Select this if you're planning to use a deployant buckle." ] } } , numberField model { key = BuckleTongueWidth , title = [ text "Buckle Tongue Width" ] , description = [ text "Width of the buckle tongue / pin." ] , unit = Just "mm" , disabled = not (hasKey HasBuckleTongue model.fields) , attrs = step "0.1" :: lengthFieldAttrs constraints.shortPiece.buckle.tongue.width } , numberField model { key = BuckleTongueThickness , title = [ text "Buckle Tongue Thickness" ] , description = [ text "Thickness of the buckle tongue / pin, to add to the cutout depth." ] , unit = Just "mm" , disabled = not (hasKey HasBuckleTongue model.fields) , attrs = step "0.1" :: lengthFieldAttrs constraints.shortPiece.buckle.tongue.thickness } ] , hr [] [] , group
-
-
-
@@ -47,7 +47,6 @@type alias Buckle = { springBarDiameter : NumberConstraints Length , tongue : BuckleTongue }
-
@@ -117,10 +116,6 @@ }, length = { min = Just (mm 5), max = Just (mm 150) } , buckle = { springBarDiameter = { min = Just (mm 1), max = Just (mm 3) } , tongue = { thickness = { min = Just (mm 0.1), max = Just (mm 3) } , width = { min = Just (mm 1), max = Just (mm 5) } } } } , lining = { min = Just (mm 0), max = Just (mm 5) }
-
-
-
@@ -20,9 +20,6 @@ | BuckleHoleCount| BuckleHoleInterval | BuckleHoleDiameter | BuckleSpringBarDiameter | HasBuckleTongue | BuckleTongueThickness | BuckleTongueWidth | LongPieceLength | LoopThickness | LoopStyle
-
@@ -73,15 +70,6 @@ "buckle-hole-interval"BuckleSpringBarDiameter -> "buckle-spring-bar-diameter" HasBuckleTongue -> "has-buckle-tongue" BuckleTongueThickness -> "buckle-tongue-thickness" BuckleTongueWidth -> "buckle-tongue-width" LongPieceLength -> "long-piece-length"
-
-
-
@@ -254,47 +254,16 @@ |> Dict.fromList|> Err parseBuckleTongue : ParametersDict -> Result Errors (Maybe Parameters.BuckleTongue) parseBuckleTongue fields = if hasKey HasBuckleTongue fields then case ( parseField BuckleTongueWidth (parseLength constraints.shortPiece.buckle.tongue.width) fields , parseField BuckleTongueThickness (parseLength constraints.shortPiece.buckle.tongue.thickness) fields ) of ( Ok width, Ok thickness ) -> Ok (Just { width = width, thickness = thickness }) ( width, thickness ) -> Err (mkErrors [ ( BuckleTongueWidth, getError width ) , ( BuckleTongueThickness, getError thickness ) ] ) else Ok Nothing parseBuckle : ParametersDict -> Result Errors Parameters.Buckle parseBuckle fields = case ( parseBuckleTongue fields , parseField BuckleSpringBarDiameter (parseLength constraints.shortPiece.buckle.springBarDiameter) fields ) parseField BuckleSpringBarDiameter (parseLength constraints.shortPiece.buckle.springBarDiameter) fields of ( Ok tongue, Ok springBarDiameter ) -> Ok { tongue = tongue, springBarDiameter = springBarDiameter } Ok springBarDiameter -> Ok { springBarDiameter = springBarDiameter } ( tongue, springBarDiameter ) -> [ getError tongue |> Maybe.withDefault Dict.empty , mkErrors [ ( BuckleSpringBarDiameter, getError springBarDiameter ) ] ] |> List.map Dict.toList |> List.concat |> Dict.fromList |> Err Err err -> Err (mkErrors [ ( BuckleSpringBarDiameter, Just err ) ]) parseShortPiece : ParametersDict -> Result Errors Parameters.ShortPiece
-
-
-
@@ -409,45 +409,6 @@ { includeCaseSideFlap = True, includeClaspSideFlap = True , at = ( p.x, p.y ) } , case params.shortPiece.buckle.tongue of Just { thickness, width } -> let springBarDiameter = toMM params.shortPiece.buckle.springBarDiameter cutoutWidth = toMM width cutoutLength = toMM thickness * 2 + (pi * (springBarDiameter / 2)) + springBarDiameter + toMM params.thickness + toMM params.lining in Svg.path [ Path.d [ MoveTo Absolute ( p.x + lugWidth / 2, p.y + caseSideFlap + length ) , MoveTo Relative ( -cutoutWidth / 2, -springBarDiameter - toMM thickness ) , VerticalLineTo Relative cutoutLength , HorizontalLineTo Relative cutoutWidth , VerticalLineTo Relative -cutoutLength , ClosePath ] , fill "none" , stroke "currentColor" , strokeWidth (toMM params.rendering.lineWidth |> String.fromFloat) , highlightStroke (highlighting == Just BuckleSpringBarDiameter || highlighting == Just BuckleTongueThickness || highlighting == Just BuckleTongueWidth || highlighting == Just SurfaceThickness ) ] [] _ -> g [] [] , g (skivingSeamStroke params) [ Svg.path
-