Changes
6 changed files (+40/-40)
-
-
@@ -139,7 +139,7 @@ "tapered"type alias Parameters = { lugWidth : Length { shoulderWidth : Length , longPiece : LongPiece , shortPiece : ShortPiece , profile : Profile
-
@@ -164,7 +164,7 @@default : Parameters default = { lugWidth = mm 20 { shoulderWidth = mm 20 , longPiece = { length = mm 112 , tip = Round
-
@@ -202,7 +202,7 @@toDict : Parameters -> ParametersDict toDict params = [ ( "version", "1.0" ) , ( Key.toString LugWidth, String.fromFloat (toMM params.lugWidth) ) , ( Key.toString ShoulderWidth, String.fromFloat (toMM params.shoulderWidth) ) , ( Key.toString LongPieceLength, String.fromFloat (toMM params.longPiece.length) ) , ( Key.toString LoopStyle, loopStyleToString params.shortPiece.loops.style ) , ( Key.toString ShortPieceLength, String.fromFloat (toMM params.shortPiece.length) )
-
-
-
@@ -527,15 +527,15 @@ view model =[ group { title = [ text "General" ], description = Nothing } [ numberField model { key = LugWidth , title = [ text "Lug width" ] { key = ShoulderWidth , title = [ text "Shoulder Width" ] , description = [ text "This will be the final width of your strap. " , text "You can use a size smaller than your lug width to create a play." [ text "Width of your strap. " , text "Should be same as or wider than your watch's lug width." ] , unit = Just "mm" , disabled = False , attrs = step "1.0" :: lengthFieldAttrs constraints.lugWidth , attrs = step "1.0" :: lengthFieldAttrs constraints.shoulderWidth } , choiceField model { key = Profile
-
@@ -545,7 +545,7 @@ , disabled = False, attrs = [] , choices = [ { label = [ text "Straight" ] , description = [ text "Lug width, tip width and buckle-edge width shares the same size." ] , description = [ text "Shoulder width, tip width and buckle-edge width shares the same size." ] , value = profileKind Parameters.Straight } , { label = [ text "Tapered" ]
-
-
-
@@ -65,7 +65,7 @@ }type alias Parameters = { lugWidth : NumberConstraints Length { shoulderWidth : NumberConstraints Length , longPiece : LongPiece , shortPiece : ShortPiece , taperTo : NumberConstraints Length
-
@@ -75,7 +75,7 @@constraints : Parameters constraints = { lugWidth = { min = Just (mm 10), max = Just (mm 30) } { shoulderWidth = { min = Just (mm 10), max = Just (mm 30) } , longPiece = { buckleHole = { count = { min = Just 0, max = Just 10 }
-
-
-
@@ -11,7 +11,7 @@ module Parameters.Key exposing (Key(..), toString)type Key = LugWidth = ShoulderWidth | Profile | TaperTo | BuckleHoleOffset
-
@@ -47,8 +47,8 @@TaperTo -> "taper-to" LugWidth -> "lug-width" ShoulderWidth -> "shoulder-width" BuckleHoleOffset -> "buckle-hole-offset"
-
-
-
@@ -375,7 +375,7 @@ parse fields =case getKey Version fields of Just "1.0" -> case ( parseField LugWidth (parseLength constraints.lugWidth) fields ( parseField ShoulderWidth (parseLength constraints.shoulderWidth) fields , ( parseLongPiece fields , parseShortPiece fields , parseProfile fields
-
@@ -383,18 +383,18 @@ ), parseRendering fields ) of ( Ok lugWidth, ( Ok longPiece, Ok shortPiece, Ok profile ), Ok rendering ) -> ( Ok shoulderWidth, ( Ok longPiece, Ok shortPiece, Ok profile ), Ok rendering ) -> Ok { lugWidth = lugWidth { shoulderWidth = shoulderWidth , longPiece = longPiece , shortPiece = shortPiece , rendering = rendering , profile = profile } ( lugWidth, ( longPiece, shortPiece, profile ), rendering ) -> ( shoulderWidth, ( longPiece, shortPiece, profile ), rendering ) -> [ mkErrors [ ( LugWidth, getError lugWidth ) [ ( ShoulderWidth, getError shoulderWidth ) ] , getError longPiece |> Maybe.withDefault Dict.empty , getError shortPiece |> Maybe.withDefault Dict.empty
-
-
-
@@ -89,8 +89,8 @@longPieceShape : ( Float, Float ) -> Parameters -> Maybe Key -> List Path.PathCommand -> Svg msg longPieceShape ( x, y ) params highlighting commands = let lugWidth = toMM params.lugWidth shoulderWidth = toMM params.shoulderWidth length = toMM params.longPiece.length
-
@@ -106,10 +106,10 @@ Straight ->0.0 Tapered to -> lugWidth - toMM to shoulderWidth - toMM to buckleWidth = lugWidth - taper shoulderWidth - taper in Svg.g []
-
@@ -139,7 +139,7 @@ , highlightStroke(highlighting == Just LongPieceLength || highlighting == Just LugWidth == Just ShoulderWidth || highlighting == Just Profile || highlighting
-
@@ -159,7 +159,7 @@ ][] , Svg.path (Path.d [ MoveTo Absolute ( x + lugWidth / 2, y ) [ MoveTo Absolute ( x + shoulderWidth / 2, y ) , VerticalLineTo Relative length ] :: highlightStroke (highlighting == Just LongPieceLength)
-
@@ -178,7 +178,7 @@ , HorizontalLineTo Relative buckleWidth] :: highlightStroke (highlighting == Just LugWidth == Just ShoulderWidth || highlighting == Just TaperTo || highlighting
-
@@ -195,13 +195,13 @@longPiece : Parameters -> Maybe Key -> Item msg longPiece params highlighting = let lugWidth = toMM params.lugWidth shoulderWidth = toMM params.shoulderWidth length = toMM params.longPiece.length in { size = { width = Exactly lugWidth, height = Exactly length } { size = { width = Exactly shoulderWidth, height = Exactly length } , element = \p _ -> g
-
@@ -227,7 +227,7 @@ inhole params buckleHole.diameter ( p.x + lugWidth / 2 ( p.x + shoulderWidth / 2 , p.y + offset + interval * toFloat index ) [ highlightStroke
-
@@ -291,8 +291,8 @@shortPieceShape : Parameters -> Maybe Key -> ( Float, Float ) -> Svg msg shortPieceShape params highlighting at = let lugWidth = toMM params.lugWidth shoulderWidth = toMM params.shoulderWidth length = toMM params.shortPiece.length
-
@@ -308,7 +308,7 @@ Straight ->0.0 Tapered to -> lugWidth - toMM to shoulderWidth - toMM to ( x, y ) = at
-
@@ -320,7 +320,7 @@ [ Path.d([ Just (MoveTo Absolute ( x, y )) , Just (LineTo Relative ( taper / 2, taperUntil )) , Just (VerticalLineTo Relative (length - taperUntil)) , Just (HorizontalLineTo Relative (lugWidth - taper)) , Just (HorizontalLineTo Relative (shoulderWidth - taper)) , Just (VerticalLineTo Relative -(length - taperUntil)) , Just (LineTo Relative ( taper / 2, -taperUntil )) , Just ClosePath
-
@@ -334,7 +334,7 @@ , highlightStroke(highlighting == Just ShortPieceLength || highlighting == Just LugWidth == Just ShoulderWidth || highlighting == Just Profile || highlighting
-
@@ -354,7 +354,7 @@ ][] , Svg.path (Path.d [ MoveTo Absolute ( x + lugWidth / 2, y ) [ MoveTo Absolute ( x + shoulderWidth / 2, y ) , VerticalLineTo Relative length ] :: highlightStroke (highlighting == Just ShortPieceLength)
-
@@ -369,7 +369,7 @@ Tapered _ ->Svg.path (Path.d [ MoveTo Absolute ( x + taper / 2, y + taperUntil ) , HorizontalLineTo Relative (lugWidth - taper) , HorizontalLineTo Relative (shoulderWidth - taper) ] :: guideStroke )
-
@@ -380,14 +380,14 @@shortPiece : Parameters -> Maybe Key -> Item msg shortPiece params highlighting = let lugWidth = toMM params.lugWidth shoulderWidth = toMM params.shoulderWidth length = toMM params.shortPiece.length in { size = { width = Exactly lugWidth, height = Exactly length } { width = Exactly shoulderWidth, height = Exactly length } , element = \p _ -> g [] [ shortPieceShape params highlighting ( p.x, p.y ) ]
-