├── .github ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .gitmodules ├── .travis.yml ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── apigen.neon ├── channels └── Core │ ├── Channel │ └── Channel.php │ └── Freesewing │ ├── Freesewing.php │ └── config.yml ├── composer.json ├── composer.lock ├── config.yml ├── freesewing ├── index.php ├── patterns ├── Beta │ ├── BenjaminBowTie │ │ ├── BenjaminBowTie.php │ │ ├── config.yml │ │ └── sampler │ │ │ └── models.yml │ ├── BentBodyBlock │ │ ├── BentBodyBlock.php │ │ ├── config.yml │ │ └── sampler │ │ │ └── models.yml │ ├── CarlitaCoat │ │ ├── CarlitaCoat.php │ │ ├── config.yml │ │ └── sampler │ │ │ └── models.yml │ ├── CarltonCoat │ │ ├── CarltonCoat.php │ │ ├── config.yml │ │ └── sampler │ │ │ └── models.yml │ ├── FlorentFlatCap │ │ ├── FlorentFlatCap.php │ │ ├── config.yml │ │ └── sampler │ │ │ └── models.yml │ ├── HueyHoodie │ │ ├── HueyHoodie.php │ │ ├── README.md │ │ ├── config.yml │ │ ├── sampler │ │ │ └── models.yml │ │ └── translations │ │ │ ├── messages.de.yml │ │ │ ├── messages.en.yml │ │ │ ├── messages.fr.yml │ │ │ └── messages.nl.yml │ ├── JaegerJacket │ │ ├── JaegerJacket.php │ │ ├── config.yml │ │ └── sampler │ │ │ └── models.yml │ ├── PenelopePencilSkirt │ │ ├── PenelopePencilSkirt.php │ │ ├── config.yml │ │ └── sampler │ │ │ └── models.yml │ ├── SandySkirt │ │ ├── SandySkirt.php │ │ ├── config.yml │ │ └── sampler │ │ │ └── models.yml │ └── ShinSwimTrunks │ │ ├── ShinSwimTrunks.php │ │ ├── config.yml │ │ ├── sampler │ │ └── models.yml │ │ └── translations │ │ └── messages.en.yml ├── Core │ ├── AaronAshirt │ │ ├── AaronAshirt.php │ │ ├── config.yml │ │ └── translations │ │ │ ├── messages.de.yml │ │ │ ├── messages.en.yml │ │ │ ├── messages.fr.yml │ │ │ └── messages.nl.yml │ ├── BrianBodyBlock │ │ ├── BrianBodyBlock.php │ │ ├── config.yml │ │ ├── sampler │ │ │ └── models.yml │ │ └── translations │ │ │ ├── messages.en.yml │ │ │ ├── messages.fr.yml │ │ │ └── messages.nl.yml │ ├── BruceBoxerBriefs │ │ ├── BruceBoxerBriefs.php │ │ ├── config.yml │ │ ├── sampler │ │ │ └── models.yml │ │ └── translations │ │ │ ├── messages.en.yml │ │ │ └── messages.nl.yml │ ├── CathrinCorset │ │ ├── CathrinCorset.php │ │ ├── config.yml │ │ ├── sampler │ │ │ └── models.yml │ │ └── translations │ │ │ ├── messages.en.yml │ │ │ ├── messages.fr.yml │ │ │ └── messages.nl.yml │ ├── HugoHoodie │ │ ├── HugoHoodie.php │ │ ├── config.yml │ │ ├── sampler │ │ │ └── models.yml │ │ └── translations │ │ │ ├── messages.de.yml │ │ │ ├── messages.en.yml │ │ │ ├── messages.fr.yml │ │ │ └── messages.nl.yml │ ├── Pattern │ │ ├── Pattern.php │ │ └── translations │ │ │ ├── messages.de.yml │ │ │ ├── messages.en.yml │ │ │ ├── messages.fr.yml │ │ │ └── messages.nl.yml │ ├── SimonShirt │ │ ├── SimonShirt.php │ │ ├── config.yml │ │ └── sampler │ │ │ └── models.yml │ ├── SvenSweatshirt │ │ ├── SvenSweatshirt.php │ │ ├── config.yml │ │ └── sampler │ │ │ └── models.yml │ ├── TamikoTop │ │ ├── TamikoTop.php │ │ ├── config.yml │ │ └── sampler │ │ │ └── models.yml │ ├── TheoTrousers │ │ ├── TheoTrousers.php │ │ └── config.yml │ ├── TheodoreTrousers │ │ ├── TheodoreTrousers.php │ │ ├── config.yml │ │ └── sampler │ │ │ └── models.yml │ ├── TrayvonTie │ │ ├── TrayvonTie.php │ │ ├── config.yml │ │ ├── sampler │ │ │ └── models.yml │ │ └── translations │ │ │ ├── messages.en.yml │ │ │ ├── messages.fr.yml │ │ │ └── messages.nl.yml │ └── WahidWaistcoat │ │ ├── WahidWaistcoat.php │ │ ├── config.yml │ │ └── sampler │ │ └── models.yml ├── Docs │ ├── ClassDocs │ │ ├── ClassDocs.php │ │ ├── config.yml │ │ └── sampler │ │ │ └── models.yml │ ├── DesignTutorial │ │ ├── DesignTutorial.php │ │ ├── config.yml │ │ ├── sampler │ │ │ └── models.yml │ │ └── translations │ │ │ ├── messages.en.yml │ │ │ └── messages.nl.yml │ └── NotationLegend │ │ ├── NotationLegend.php │ │ └── config.yml ├── Templates │ └── PatternTemplate │ │ ├── PatternTemplate.php │ │ ├── config.yml │ │ └── sampler │ │ └── models.yml └── Tests │ └── TestPattern │ ├── TestPattern.php │ ├── config.yml │ └── sampler │ └── models.yml ├── phpunit.xml ├── scripts ├── deploy.sh ├── test.php ├── test.sh ├── testall.php └── testall.sh ├── src ├── BezierToolbox │ └── BezierToolbox.php ├── Boundary │ └── Boundary.php ├── Context │ └── Context.php ├── Coords │ └── Coords.php ├── Dimension │ └── Dimension.php ├── GrowingPacker │ └── GrowingPacker.php ├── LayoutBlock │ └── LayoutBlock.php ├── MeasurementsSampler │ └── MeasurementsSampler.php ├── Model │ └── Model.php ├── Note │ └── Note.php ├── OptionsSampler │ └── OptionsSampler.php ├── Packer │ └── Packer.php ├── Part │ └── Part.php ├── Path │ └── Path.php ├── Point │ └── Point.php ├── Polynomial │ └── Polynomial.php ├── Request │ └── Request.php ├── Response │ └── Response.php ├── Sampler │ └── Sampler.php ├── Services │ ├── CompareService.php │ ├── DraftService.php │ ├── InfoService.php │ ├── SampleService.php │ └── Service.php ├── Stack │ └── Stack.php ├── SvgAttributes │ └── SvgAttributes.php ├── SvgBlock │ └── SvgBlock.php ├── SvgComments │ └── SvgComments.php ├── SvgCss │ └── SvgCss.php ├── SvgDefs │ └── SvgDefs.php ├── SvgDocument │ └── SvgDocument.php ├── SvgInclude │ └── SvgInclude.php ├── SvgRenderbot │ └── SvgRenderbot.php ├── SvgScript │ └── SvgScript.php ├── SvgSnippet │ └── SvgSnippet.php ├── Text │ └── Text.php ├── TextOnPath │ └── TextOnPath.php ├── Transform │ └── Transform.php ├── Utils │ └── Utils.php ├── Vector │ └── Vector.php └── Yamlr │ └── Yamlr.php ├── tests ├── channels │ └── FreesewingTest.php ├── patterns │ └── TestPatternTest.php ├── src │ ├── BezierToolboxTest.php │ ├── BoundaryTest.php │ ├── CompareServiceTest.php │ ├── ContextTest.php │ ├── CoordsTest.php │ ├── DimensionTest.php │ ├── DraftServiceTest.php │ ├── GrowningPackerTest.php │ ├── InfoServiceTest.php │ ├── LayoutBlockTest.php │ ├── MeasurementsSamplerTest.php │ ├── ModelTest.php │ ├── NoteTest.php │ ├── OptionsSamplerTest.php │ ├── Part.offsetCode.Test.php │ ├── PartTest.php │ ├── PathTest.php │ ├── PointTest.php │ ├── PolynomialTest.php │ ├── RequestTest.php │ ├── ResponseTest.php │ ├── SampleServiceTest.php │ ├── SamplerTest.php │ ├── StackTest.php │ ├── SvgAttributesTest.php │ ├── SvgCommentsTest.php │ ├── SvgCssTest.php │ ├── SvgDefsTest.php │ ├── SvgDocumentTest.php │ ├── SvgIncludeTest.php │ ├── SvgRenderbotTest.php │ ├── SvgScriptTest.php │ ├── SvgSnippetTest.php │ ├── TransformTest.php │ ├── UtilsTest.php │ ├── VectorTest.php │ ├── YamlrTest.php │ ├── assets │ │ └── testFunctions.php │ └── fixtures │ │ ├── GrowingPacker.1.layout │ │ ├── GrowingPacker.12.layout │ │ ├── GrowingPacker.2.layout │ │ ├── GrowingPacker.4.layout │ │ ├── GrowingPacker.8.layout │ │ ├── Part.cutOnFold.data │ │ ├── Part.grainline.data │ │ ├── Part.heightDimensions.data │ │ ├── Part.linearDimensions.data │ │ ├── Part.nearDimensions.data │ │ ├── Part.newCurvedDimension.data │ │ ├── Part.notch.data │ │ ├── Part.note.data │ │ ├── Part.offset.curveOffset.data │ │ ├── Part.offset.curveOffsetCp1IsStart.data │ │ ├── Part.offset.curveOffsetCp2IsEnd.data │ │ ├── Part.offset.lineOffset.data │ │ ├── Part.offset.lineOffsetClosedPath.data │ │ ├── Part.offset.offsetCurveCurve.data │ │ ├── Part.offset.offsetCurveLine.data │ │ ├── Part.offset.offsetLineCurve.data │ │ ├── Part.offset.offsetLineLine.data │ │ ├── Part.title.default.data │ │ ├── Part.title.extraSmall.data │ │ ├── Part.title.horitzontalSmall.data │ │ ├── Part.title.horizontal.data │ │ ├── Part.title.horizontalSmall.data │ │ ├── Part.title.vertical.data │ │ ├── Part.title.verticalSmall.data │ │ ├── Part.widthDimensions.data │ │ ├── Sampler.parts.data │ │ ├── SvgRenderbot.dimension.svg │ │ ├── SvgRenderbot.include.svg │ │ ├── SvgRenderbot.note.svg │ │ ├── SvgRenderbot.path.svg │ │ ├── SvgRenderbot.pathFromPart.svg │ │ ├── SvgRenderbot.pattern.svg │ │ ├── SvgRenderbot.snippet.svg │ │ ├── SvgRenderbot.text.svg │ │ ├── SvgRenderbot.textOnPath.svg │ │ ├── SvgRenderbot.transform.svg │ │ ├── Utils.debug.txt │ │ ├── YamlrTest.correct.yml │ │ └── YamlrTest.incorrect.yml └── themes │ ├── BasicTest.php │ ├── DesignerTest.php │ ├── DeveloperTest.php │ ├── InfoTest.php │ ├── PaperlessTest.php │ └── fixtures │ ├── Designer.themePatternBasic.data │ ├── Info.infoHtml.data │ ├── Info.patternInfoHtml.data │ ├── Info.patternInfoJson.data │ ├── Info.patternInfoOther.data │ └── Info.patternInfoPhp.data └── themes └── Core ├── Basic ├── Basic.php └── config.yml ├── BasicJson ├── BasicJson.php └── config.yml ├── Compare ├── Compare.php ├── config.yml └── templates │ ├── footer-comments │ ├── header-comments │ ├── style.css │ └── svg-attributes ├── Designer ├── Designer.php ├── config.yml └── templates │ ├── css │ └── designer.css │ ├── defs │ └── designer │ ├── js │ └── designer.js │ └── sass │ └── designer.scss ├── Designerless ├── Designerless.php └── config.yml ├── Developer ├── Developer.php └── config.yml ├── Info ├── Info.php └── templates │ ├── footer-comments │ ├── header-comments │ ├── style.css │ └── svg-attributes ├── Paperless ├── Paperless.php ├── config.yml └── templates │ ├── css │ └── paperless.css │ ├── defs │ ├── grid.imperial │ └── grid.metric │ └── sass │ ├── paperless.scss │ └── variables.scss ├── PaperlessJson ├── PaperlessJson.php ├── config.yml └── templates │ ├── css │ └── paperless.css │ ├── defs │ ├── grid.imperial │ └── grid.metric │ └── sass │ ├── paperless.scss │ └── variables.scss ├── Sampler ├── Sampler.php ├── config.yml └── templates │ ├── footer-comments │ ├── header-comments │ ├── style.css │ └── svg-attributes └── Theme ├── Theme.php ├── config.yml ├── templates ├── attributes │ └── svg ├── comments │ ├── footer │ └── header ├── css │ └── style.css ├── defs │ ├── base │ ├── buttonholes │ ├── buttons │ ├── logo │ ├── scalebox │ └── snaps └── sass │ ├── style.scss │ └── variables.scss └── translations ├── messages.de.yml ├── messages.en.yml ├── messages.fr.yml └── messages.nl.yml /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Please see our contributing guidelines at [https://freesewing.org/contribute](https://freesewing.org/contribute) 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | While I appreciate you are reporting an issue, here are some things to keep in mind: 2 | 3 | **File your issue in the right place** 4 | 5 | - Problems with patterns are for the [core](https://github.com/freesewing/core/issues/new) repository 6 | - Website issues are for the [site](https://github.com/freesewing/site/issues/new) repository 7 | - Problems with the data backend are for the [data](https://github.com/freesewing/data/issues/new) repository 8 | 9 | **Provide relevant data** 10 | 11 | This depends on what you're reporting, but useful info is: 12 | 13 | - Your username on the site 14 | - The hash of your draft 15 | - Any error message you may have received 16 | 17 | **Give it a good title** 18 | 19 | Be descriptive, because people who skim this list are more likely to turn 20 | their attention to your issue if you give it a good title. 21 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Thank you for this pull request. Please use this field to briefly explain the changes you've made. 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | vendor/ 2 | print/ 3 | .php_cs.cache 4 | .sass_cache/ 5 | coverage 6 | .buildpath 7 | .externalToolBuilders/ 8 | .metadata/ 9 | .project 10 | .settings/ 11 | .idea/ 12 | scripts/test.log 13 | .gitmodules 14 | tags 15 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joostdecock/core/e313c2cd078745812995ae63bfe1a64d0b8632c3/.gitmodules -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | php: 3 | - '5.6' 4 | - '7.0' 5 | - '7.1' 6 | addons: 7 | apt: 8 | packages: 9 | - sshpass 10 | install: 11 | - composer install --no-interaction --no-dev 12 | - composer dump-autoload -o 13 | env: 14 | global: 15 | - DEPLOY_HOST=lin.freesewing.org 16 | - DEPLOY_USER=travis 17 | - DEPLOY_PATH=/fs/deploy/core/ 18 | - secure: iXJjf3hixPU+AmWdYqRF8iT1/jQf4PP0smyibRhLjG3PoiN9hyHMoH2T9FyXX8Gd49HcEW275TERwb+MEKA0omPJtnSE4SikfwW1hR8s4Ulki1WSkvH+yGlFggZhUlTht9pSxu4qASUJx9J+IBF4A2AgeZPHD8YWkHf4OHn3+DhlzBTsI49g3ZT+h8jXJAqBSMwNDbELFI4UMllVub9QrdnCCofBJlZ1XkFWyF59z0RNKO9D9NRu39nMFzpLqKQGYCf/StNBJgut8Myapy3zupn6WXDgOLyPZ7EJMuHwRJmeMWg95oADhOWWWhWyH/chxoeHZ954AIxHyiNOQo9Pyy7QgcLPdOicZgNvvrAnLo/RAiLMcndTNUVFPPmLUR4BquzNFyJE7FLQEkcoUMDxLk5112Nreunh6Hi1GQWtkM0PoMOJjhAb4x8s7BsZFRC2dv52vqum6EcoqeEUPETxY6JCw1ZMW4NyOp3wk8KvXdpNKOisT2l9E5b8khexycxWPk2ErwiW/LqAIfhlRi0/G9yKMv+S+b4OTyCDbwsEx2dG+mZcfe4oj9gpuYKmWhMDqRUR0jdHIzIH5PF6aAzNjDY2afbqVCUfFM7IIpjbr8573c5yQ9JIBYB1rCGudYjIIVOJN6oMB9Tt+ancGt0Vz9AiFgH+v79YMLUiE5du+hc= 19 | script: 20 | - phpunit 21 | - "./scripts/test.sh" 22 | deploy: 23 | provider: script 24 | script: scripts/deploy.sh 25 | skip_cleanup: true 26 | on: 27 | all_branches: true 28 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | Please see our code of conduct at [https://freesewing.org/about/code-of-conduct](https://freesewing.org/about/code-of-conduct) 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DEPRECATED: Please see freesewing/freesewing instead 2 | 3 | FreeSewing v2 and up are maintained in the [freesewing](https://github.com/freesewing/freesewing) repository. 4 | 5 | 6 | 7 | [![Build Status](https://travis-ci.org/freesewing/core.svg?branch=master)](https://travis-ci.org/freesewing/core) 8 | 9 | # Freesewing core 10 | [Freesewing](https://freesewing.org/) is an online platform to draft sewing patterns based on your measurements. 11 | 12 | > This is the core repository, which holds the platform and the sewing patterns I maintain. 13 | 14 | For all info on what freesewing does/is/provides, please check [the about page](https://freesewing.org/about/) or [documentation](https://freesewing.org/docs/). 15 | 16 | ## System Requirements 17 | * PHP 5.6 or newer 18 | * composer 19 | 20 | ## Installation 21 | 22 | Full install instructions are available at [freesewing.org/docs/core/install](https://freesewing.org/docs/core/install) 23 | but here's the gist of it: 24 | 25 | > ##### A note about installing on PHP 5.6 26 | > 27 | > Core uses a Developer theme that requires PHP 7.0 or newer. However, that theme is only 28 | > useful for hacking core. So if you just want to run this and maybe design some patterns 29 | > install without the dev requirements. 30 | > 31 | > In other words, to install on PHP 5.6, pass `--no-dev` to composer 32 | 33 | ### From packagist 34 | ``` 35 | composer create-project freesewing/core 36 | cd core 37 | composer dump-autoload -o 38 | ``` 39 | 40 | ### From GitHub 41 | ``` 42 | git clone git@github.com:freesewing/core.git 43 | cd core 44 | composer install 45 | composer dump-autoload -o 46 | ``` 47 | 48 | ## License 49 | This code is licensed [GPL-3](https://www.gnu.org/licenses/gpl-3.0.en.html), 50 | the pattern drafts, documentation, and other content is licensed [CC-BY](https://creativecommons.org/licenses/by/4.0/). 51 | 52 | ## Contribute 53 | 54 | Your pull request are welcome here. 55 | 56 | If you're interested in contributing, I'd love your help. 57 | That's exactly why I made this thing open source in the first place. 58 | 59 | Read [freesewing.org/contribute](https://freesewing.org/contribute) to get started. 60 | If you have any questions, the best place to ask is [the freesewing community on Gitter](https://gitter.im/freesewing/freesewing). 61 | -------------------------------------------------------------------------------- /apigen.neon: -------------------------------------------------------------------------------- 1 | # Dirs or files documentation is generated for. 2 | source: 3 | - src/ 4 | - patterns/Core/Pattern/ 5 | - themes/ 6 | - channels/ 7 | 8 | # Target dir for documentation. 9 | destination: ../site/apigen/core 10 | 11 | # Access levels of included method and properties. (default: ["public","protected"]) (multiple values allowed) 12 | accessLevels: 13 | - public 14 | - private 15 | - protected 16 | 17 | # Base url used for sitemap (useful for public doc). 18 | baseUrl: https://freesewing.org/apigen/core/ 19 | 20 | # Turn on debug mode. 21 | debug: false 22 | 23 | # Generate documentation for elements marked as @deprecated 24 | deprecated: false 25 | 26 | # Add link to ZIP archive of documentation. 27 | download: true 28 | 29 | # Scanned file extensions. (default: ["php"]) (multiple values allowed) 30 | extensions: 31 | - php 32 | 33 | # Directories and files matching this mask will not be parsed (e.g. */tests/*). (multiple values allowed) 34 | exclude: 35 | - vendor/ 36 | 37 | # Charset of scanned files. (multiple values allowed) 38 | charset: 39 | - utf-8 40 | 41 | # Elements with this name prefix will be first in tree. 42 | # main: 43 | 44 | # Include elements marked as @internal. 45 | internal: true 46 | 47 | # Generate documentation for PHP internal classes. 48 | php: false 49 | 50 | # Title of generated documentation. 51 | title: Freesewing core 52 | 53 | # Generate documentation for elements marked as @todo. 54 | todo: true 55 | 56 | # Generate tree view of classes, interfaces, traits and exceptions. 57 | tree: true 58 | 59 | -------------------------------------------------------------------------------- /channels/Core/Freesewing/config.yml: -------------------------------------------------------------------------------- 1 | headers: 2 | 'Access-Control-Allow-Origin': '*' 3 | 'X-Generated-By': 'freesewing' 4 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "freesewing/core", 3 | "description": "Freesewing is an open source platform for made-to-measure sewing patterns", 4 | "license": "GPL-3.0-or-later", 5 | "homepage": "https://freesewing.org/", 6 | "authors": [ 7 | { 8 | "name": "Joost De Cock", 9 | "email": "joost@decock.org", 10 | "homepage": "http://joost.decock.org/", 11 | "role": "Developer" 12 | }], 13 | "require": { 14 | "symfony/translation": "3.1.*", 15 | "symfony/yaml": "3.1.*", 16 | "freesewing/bail": "^0.2.0", 17 | "kint-php/kint": "^2.2" 18 | }, 19 | "require-dev": { 20 | "phpunit/phpunit": "5.5.*" 21 | }, 22 | "autoload": { 23 | "psr-4": { 24 | "Freesewing\\": "src/", 25 | "Freesewing\\Channels\\": "channels/", 26 | "Freesewing\\Themes\\": "themes/", 27 | "Freesewing\\Patterns\\": "patterns/" 28 | } 29 | }, 30 | "scripts": { 31 | "test": "phpunit" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /config.yml: -------------------------------------------------------------------------------- 1 | version: 1.11.1 2 | defaults: 3 | service: draft 4 | channel: Freesewing 5 | draftTheme: Basic 6 | sampleTheme: Sampler 7 | compareTheme: Compare 8 | infoTheme: Info 9 | pattern: TestPattern 10 | locale: en 11 | 12 | services: 13 | - info 14 | - draft 15 | - sample 16 | - compare 17 | 18 | patternNamespaces: 19 | - Core 20 | - Beta 21 | - Docs 22 | - Templates 23 | - Tests 24 | 25 | themeNamespaces: 26 | - Core 27 | 28 | channelNamespaces: 29 | - Core 30 | 31 | integrations: 32 | bail: 33 | bail_enabled: false 34 | api: 'https://data.freesewing.org/error' 35 | origin: 'core.freesewing.org' 36 | -------------------------------------------------------------------------------- /freesewing: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ $# -eq 0 ] 4 | then 5 | bold=$(tput bold) 6 | normal=$(tput sgr0) 7 | echo "${bold}USAGE:" 8 | echo "${normal} freesewing [key=value ...]" 9 | echo "" 10 | echo "${bold}EXAMPLES:" 11 | echo "${bold} Show this help:" 12 | echo "${normal} freesewing" 13 | echo "" 14 | echo "${bold} Contact the info service, return data in text format:" 15 | echo "${normal} freesewing service=info format=text" 16 | echo "" 17 | echo "${bold} Get info on the SimonShirt pattern:" 18 | echo "${normal} freesewing service=info format=text pattern=SimonShirt" 19 | echo "" 20 | echo "${bold} Draft the WahidWaistcoat pattern with default measurements and options:" 21 | echo "${normal} freesewing service=draft pattern=WahidWaistcoat" 22 | echo "" 23 | echo "${bold}SEE ALSO:" 24 | echo "${normal} https://freesewing.org/docs/core/cli" 25 | else 26 | for var in "$@" 27 | do 28 | input="${input} $var" 29 | done 30 | php index.php $input 31 | fi 32 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 8 | * @copyright 2016 Joost De Cock 9 | * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, Version 3 10 | * @see https://github.com/joostdecock/freesewing Code repository on GitHub 11 | */ 12 | 13 | // Sensible error settings 14 | ini_set("display_errors", 0); 15 | ini_set("log_errors", 1); 16 | 17 | require __DIR__.'/vendor/autoload.php'; 18 | $context = new \Freesewing\Context(); 19 | $context->setRequest(new \Freesewing\Request($_REQUEST)); 20 | $context->configure(); 21 | 22 | 23 | // Use bail for error handling? 24 | use Freesewing\Bail\ErrorHandler; 25 | if($context->getConfig()['integrations']['bail']['bail_enabled'] === true) { 26 | ErrorHandler::init( 27 | $context->getConfig()['integrations']['bail']['api'], 28 | $context->getConfig()['integrations']['bail']['origin'] 29 | ); 30 | } 31 | 32 | $context->runService(); 33 | -------------------------------------------------------------------------------- /patterns/Beta/BenjaminBowTie/config.yml: -------------------------------------------------------------------------------- 1 | info: 2 | name: "Benjamin Bow Tie" 3 | description: "Benjamin is a bow tie pattern with four different shape options." 4 | handle: "benjamin" 5 | level: 4 6 | tags: 7 | - accessories 8 | 9 | seamAllowance: 10 | metric: 0.6 11 | imperial: 0.25 12 | 13 | languages: 14 | en: "English" 15 | 16 | parts: 17 | bowTie1: "Bow Tie knot" 18 | bowTie2: "Bow Tie knot" 19 | bowTie3: "Bow Tie knot" 20 | collarBand: "Collar band" 21 | 22 | measurements: 23 | neckCircumference: 394 24 | 25 | options: 26 | # Style group 27 | tipWidth: 28 | title: "Tip width" 29 | description: "The width of the wings of the bow tie at the tip." 30 | group: "style" 31 | type: measure 32 | min: 24 33 | max: 80 34 | default: 65 35 | dependsOn: bowStyle 36 | onlyOn: [diamond,buterfly,widesquare] 37 | knotWidth: 38 | title: "Knot width" 39 | description: "The width of the tie at the knot/middle." 40 | group: "style" 41 | type: measure 42 | min: 24 43 | max: 40 44 | default: 30 45 | bowLength: 46 | title: "Bow length" 47 | description: "The length of the wings of the bow tie." 48 | group: "style" 49 | type: measure 50 | min: 100 51 | max: 140 52 | default: 120 53 | bowStyle: 54 | title: "Bow style" 55 | description: "The style of the bow." 56 | group: "style" 57 | type: "chooseOne" 58 | options: 59 | diamond: "Diamond" 60 | butterfly: "Butterfly" 61 | square: "Square" 62 | widesquare: "Wide Square" 63 | default: "diamond" 64 | endStyle: 65 | title: "End style" 66 | description: "The style of the end of the tie." 67 | group: "style" 68 | type: "chooseOne" 69 | options: 70 | straight: "Straight end" 71 | pointed: "Pointed end" 72 | rounded: "Rounded end" 73 | default: "straight" 74 | 75 | # Fit group 76 | collarEase: 77 | title: "Collar ease" 78 | description: "The amount of ease around your neck." 79 | group: "ease" 80 | type: "measure" 81 | min: 0 82 | max: 40 83 | default: 15 84 | adjustmentRibbon: 85 | title: "Adjustment Ribbon" 86 | description: "Add a ribbon to make the tie adjustable." 87 | group: "sewing" 88 | type: "chooseOne" 89 | options: 90 | 0: "Do not include ribbon" 91 | 1: "Include ribbon" 92 | default: 0 93 | -------------------------------------------------------------------------------- /patterns/Beta/BenjaminBowTie/sampler/models.yml: -------------------------------------------------------------------------------- 1 | default: 2 | group: maleStandardUsSizes 3 | 4 | groups: 5 | maleStandardUsSizes: 6 | - usSize34 7 | - usSize36 8 | - usSize38 9 | - usSize40 10 | - usSize42 11 | - usSize44 12 | 13 | measurements: 14 | neckCircumference: 15 | usSize34: 366 16 | usSize36: 378 17 | usSize38: 391 18 | usSize40: 404 19 | usSize42: 416 20 | usSize44: 429 21 | -------------------------------------------------------------------------------- /patterns/Beta/BentBodyBlock/sampler/models.yml: -------------------------------------------------------------------------------- 1 | default: 2 | group: maleStandardUsSizes 3 | groups: 4 | realMen: 5 | - joost 6 | maleStandardUsSizes: 7 | - usSize34 8 | - usSize36 9 | - usSize38 10 | - usSize40 11 | - usSize42 12 | - usSize44 13 | measurements: 14 | shoulderToElbow: 15 | joost : 340 16 | usSize34: 330 17 | usSize36: 340 18 | usSize38: 350 19 | usSize40: 360 20 | usSize42: 370 21 | usSize44: 380 22 | ukSize10: 330 23 | ukSize12: 335 24 | ukSize14: 340 25 | ukSize16: 345 26 | 27 | -------------------------------------------------------------------------------- /patterns/Beta/CarlitaCoat/sampler/models.yml: -------------------------------------------------------------------------------- 1 | default: 2 | group: ukFemaleSizes 3 | groups: 4 | ukFemaleSizes: 5 | - ukSize10 6 | - ukSize12 7 | - ukSize14 8 | - ukSize16 9 | measurements: 10 | highBust: 11 | ukSize10: 774 12 | ukSize12: 810 13 | ukSize14: 846 14 | ukSize16: 882 15 | bustSpan: 16 | ukSize10: 178 17 | ukSize12: 190 18 | ukSize14: 202 19 | ukSize16: 214 20 | highPointShoulderToBust: 21 | ukSize10: 265 22 | ukSize12: 275 23 | ukSize14: 285 24 | ukSize16: 295 25 | 26 | -------------------------------------------------------------------------------- /patterns/Beta/CarltonCoat/sampler/models.yml: -------------------------------------------------------------------------------- 1 | measurements: 2 | naturalWaist: 3 | joost : 885 4 | usSize34: 697 5 | usSize36: 755 6 | usSize38: 813 7 | usSize40: 871 8 | usSize42: 929 9 | usSize44: 987 10 | ukSize10: 610 11 | ukSize12: 610 12 | ukSize14: 610 13 | ukSize16: 610 14 | seatCircumference: 15 | joost : 950 16 | usSize34: 920 17 | usSize36: 955 18 | usSize38: 990 19 | usSize40: 1025 20 | usSize42: 1060 21 | usSize44: 1095 22 | ukSize10: 870 23 | ukSize12: 920 24 | ukSize14: 970 25 | ukSize16: 1020 26 | naturalWaistToFloor: 27 | joost : 1060 28 | usSize34: 940 29 | usSize36: 960 30 | usSize38: 980 31 | usSize40: 1000 32 | usSize42: 1020 33 | usSize44: 1040 34 | ukSize10: 975 35 | ukSize12: 990 36 | ukSize14: 1005 37 | ukSize16: 1020 38 | naturalWaistToSeat: 39 | joost : 230 40 | usSize34: 160 41 | usSize36: 170 42 | usSize38: 180 43 | usSize40: 190 44 | usSize42: 200 45 | usSize44: 210 46 | ukSize10: 217 47 | ukSize12: 220 48 | ukSize14: 223 49 | ukSize16: 226 50 | 51 | -------------------------------------------------------------------------------- /patterns/Beta/FlorentFlatCap/config.yml: -------------------------------------------------------------------------------- 1 | info: 2 | name: "Florent Flat Cap" 3 | description: "Florent is a flat cap, a rounded cap with a small stiff brim in front." 4 | handle: "florent" 5 | level: 4 6 | tags: 7 | - menswear 8 | - womenswear 9 | - hats 10 | - accessories 11 | 12 | parts: 13 | top: "Cap Top" 14 | side: "Cap Side" 15 | brimBottom: "Cap Brim Bottom" 16 | brimTop: "Cap Brim Top" 17 | brimPlastic: "Cap Brim Interfacing" 18 | 19 | languages: 20 | en: "English" 21 | 22 | measurements: 23 | headCircumference: 600 24 | 25 | options: 26 | headEase: 27 | group: "fit" 28 | title: "Head ease" 29 | description: "The amount of ease to fit the cap on your head." 30 | type: "measure" 31 | min: 0 32 | max: 25 33 | default: 10 34 | -------------------------------------------------------------------------------- /patterns/Beta/FlorentFlatCap/sampler/models.yml: -------------------------------------------------------------------------------- 1 | default: 2 | group: standardSizes 3 | groups: 4 | realMen: 5 | - quentin 6 | standardSizes: 7 | - small 8 | - medium 9 | - large 10 | - xlarge 11 | - xxlarge 12 | 13 | measurements: 14 | headCircumference: 15 | quentin: 605 16 | small: 545 17 | medium: 563 18 | large: 582 19 | xlarge: 600 20 | xxlarge: 625 21 | 22 | options: 23 | brimLength: 24 | quentin: 0 25 | small: 0 26 | medium: 0 27 | large: 0 28 | xlarge: 0 29 | xxlarge: 0 -------------------------------------------------------------------------------- /patterns/Beta/HueyHoodie/README.md: -------------------------------------------------------------------------------- 1 | # HueyHoodie 2 | A zip-up hoodie pattern. 3 | 4 | This should make its way into freesewing core one day. 5 | But for now, I'm just working on it here. 6 | 7 | -------------------------------------------------------------------------------- /patterns/Beta/HueyHoodie/sampler/models.yml: -------------------------------------------------------------------------------- 1 | measurements: 2 | headCircumference: 3 | joost : 590 4 | usSize34: 564 5 | usSize36: 567 6 | usSize38: 570 7 | usSize40: 573 8 | usSize42: 576 9 | usSize44: 579 10 | -------------------------------------------------------------------------------- /patterns/Beta/HueyHoodie/translations/messages.de.yml: -------------------------------------------------------------------------------- 1 | "Pouch": "Tasche" 2 | "Hood": "Kapuze" 3 | -------------------------------------------------------------------------------- /patterns/Beta/HueyHoodie/translations/messages.en.yml: -------------------------------------------------------------------------------- 1 | "Pouch": "Pouch" 2 | "Hood": "Hood" 3 | -------------------------------------------------------------------------------- /patterns/Beta/HueyHoodie/translations/messages.fr.yml: -------------------------------------------------------------------------------- 1 | "Pouch": "Poche" 2 | "Hood": "Capuchon" 3 | -------------------------------------------------------------------------------- /patterns/Beta/HueyHoodie/translations/messages.nl.yml: -------------------------------------------------------------------------------- 1 | "Pouch": "Zak" 2 | "Hood": "Kap" 3 | -------------------------------------------------------------------------------- /patterns/Beta/JaegerJacket/sampler/models.yml: -------------------------------------------------------------------------------- 1 | default: 2 | group: maleStandardUsSizes 3 | groups: 4 | realMen: 5 | - joost 6 | maleStandardUsSizes: 7 | - usSize34 8 | - usSize36 9 | - usSize38 10 | - usSize40 11 | - usSize42 12 | - usSize44 13 | measurements: 14 | 15 | naturalWaist: 16 | joost : 885 17 | usSize34: 697 18 | usSize36: 755 19 | usSize38: 813 20 | usSize40: 871 21 | usSize42: 929 22 | usSize44: 987 23 | -------------------------------------------------------------------------------- /patterns/Beta/SandySkirt/sampler/models.yml: -------------------------------------------------------------------------------- 1 | default: 2 | group: ukFemaleSizes 3 | groups: 4 | ukFemaleSizes: 5 | - ukSize10 6 | - ukSize12 7 | - ukSize14 8 | - ukSize16 9 | measurements: 10 | naturalWaistToHip: 11 | ukSize10: 130 12 | ukSize12: 135 13 | ukSize14: 140 14 | ukSize16: 145 15 | hipsCircumference: 16 | ukSize10: 935 17 | ukSize12: 985 18 | ukSize14: 1035 19 | ukSize16: 1085 20 | naturalWaist: 21 | ukSize10: 700 22 | ukSize12: 750 23 | ukSize14: 800 24 | ukSize16: 850 25 | 26 | -------------------------------------------------------------------------------- /patterns/Beta/ShinSwimTrunks/config.yml: -------------------------------------------------------------------------------- 1 | info: 2 | name: "Shin Swim Trunks" 3 | description: "Shin is a close-fitting swim trunk pattern for men." 4 | handle: "shin" 5 | level: 4 6 | tags: 7 | - accessories 8 | - sportswear 9 | 10 | parts: 11 | front: "Front" 12 | back: "Back" 13 | waistband: "Waistband" 14 | 15 | languages: 16 | en: English 17 | 18 | measurements: 19 | hipsCircumference: 970 20 | upperLegCircumference: 600 21 | hipsToUpperLeg: 220 22 | 23 | options: 24 | elasticWidth: 25 | title: "Elastic width" 26 | description: "Width of the elastic band you intend to use." 27 | group: "fit" 28 | type: "measure" 29 | min: 15 30 | max: 60 31 | default: 35 32 | stretch: 33 | title: "Stretch" 34 | description: "The amount of negative ease." 35 | group: "fit" 36 | type: "percent" 37 | min: 10 38 | max: 30 39 | default: 20 40 | bulge: 41 | title: "Bulge" 42 | description: "Create some extra room in the front." 43 | group: "fit" 44 | type: "percent" 45 | min: 0 46 | max: 5 47 | default: 2.5 48 | legReduction: 49 | title: "Leg reduction" 50 | description: "Further increases negative ease at the legs to avoid gaping." 51 | group: "fit" 52 | type: "percent" 53 | min: 0 54 | max: 10 55 | default: 5 56 | legBonus: 57 | title: "Leg bonus" 58 | description: "Increases the length of the legs." 59 | group: "style" 60 | type: "percent" 61 | min: 0 62 | max: 50 63 | default: 0 64 | rise: 65 | title: "Rise" 66 | description: "How much to raise the trunks above the default height." 67 | group: "style" 68 | type: "percent" 69 | min: 0 70 | max: 25 71 | default: 0 72 | backRise: 73 | title: "Back rise" 74 | description: "How much to raise the trunks extra at the back." 75 | group: "style" 76 | type: "percent" 77 | min: 0 78 | max: 10 79 | default: 5 80 | -------------------------------------------------------------------------------- /patterns/Beta/ShinSwimTrunks/sampler/models.yml: -------------------------------------------------------------------------------- 1 | default: 2 | group: maleStandardUsSizes 3 | groups: 4 | realMen: 5 | - joost 6 | maleStandardUsSizes: 7 | - usSize34 8 | - usSize36 9 | - usSize38 10 | - usSize40 11 | - usSize42 12 | - usSize44 13 | measurements: 14 | hipsCircumference: 15 | joost : 960 16 | usSize34: 722 17 | usSize36: 780 18 | usSize38: 838 19 | usSize40: 896 20 | usSize42: 954 21 | usSize44: 1012 22 | upperLegCircumference: 23 | joost : 600 24 | usSize34: 520 25 | usSize36: 540 26 | usSize38: 560 27 | usSize40: 580 28 | usSize42: 600 29 | usSize44: 620 30 | hipsToUpperLeg: 31 | joost : 220 32 | usSize34: 180 33 | usSize36: 190 34 | usSize38: 200 35 | usSize40: 210 36 | usSize42: 220 37 | usSize44: 230 38 | -------------------------------------------------------------------------------- /patterns/Beta/ShinSwimTrunks/translations/messages.en.yml: -------------------------------------------------------------------------------- 1 | "front": "Front" 2 | "back": "Back" 3 | "waistband": "Waistband" 4 | -------------------------------------------------------------------------------- /patterns/Core/AaronAshirt/translations/messages.de.yml: -------------------------------------------------------------------------------- 1 | "Cut one strip to finish the neck opening": "Einen Streifen für die Halsöffnung zuschneiden" 2 | "Cut two strips to finish the armholes": "Zwei Streifen für die Armöffnungen zuschneiden" 3 | -------------------------------------------------------------------------------- /patterns/Core/AaronAshirt/translations/messages.en.yml: -------------------------------------------------------------------------------- 1 | "Cut two strips to finish the armholes": "Cut two strips to finish the armholes" 2 | "Cut one strip to finish the neck opening": "Cut one strip to finish the neck opening" 3 | -------------------------------------------------------------------------------- /patterns/Core/AaronAshirt/translations/messages.fr.yml: -------------------------------------------------------------------------------- 1 | "Cut two strips to finish the armholes": "Couper deux bandes pour finir les emmanchures" 2 | "Cut one strip to finish the neck opening": "Couper une bande pour finir l’encolure" 3 | -------------------------------------------------------------------------------- /patterns/Core/AaronAshirt/translations/messages.nl.yml: -------------------------------------------------------------------------------- 1 | "Cut one strip to finish the neck opening": "Knip 2 repels uit om de halsuitsnijding af te werken" 2 | "Cut two strips to finish the armholes": "Knip 2 repels uit om de armsgaten af te werken" 3 | -------------------------------------------------------------------------------- /patterns/Core/BrianBodyBlock/translations/messages.en.yml: -------------------------------------------------------------------------------- 1 | 'Back block': 'Back block' 2 | 'Front block': 'Front block' 3 | 'Sleeve block': 'Sleeve block' 4 | -------------------------------------------------------------------------------- /patterns/Core/BrianBodyBlock/translations/messages.fr.yml: -------------------------------------------------------------------------------- 1 | 'Back block': 'Bloc du dos' 2 | 'Front block': 'Bloc du devant' 3 | 'Sleeve block': 'Bloc de la manche' 4 | -------------------------------------------------------------------------------- /patterns/Core/BrianBodyBlock/translations/messages.nl.yml: -------------------------------------------------------------------------------- 1 | 'Back block': 'Rug blok' 2 | 'Front block': 'Voorzijde blok' 3 | 'Sleeve block': 'Mouw blok' 4 | -------------------------------------------------------------------------------- /patterns/Core/BruceBoxerBriefs/config.yml: -------------------------------------------------------------------------------- 1 | info: 2 | name: "Bruce Boxer Briefs" 3 | description: "Bruce are comfortable yet stylish boxer briefs." 4 | handle: "bruce" 5 | level: 4 6 | tags: 7 | - menswear 8 | - underwear 9 | - bottom 10 | 11 | parts: 12 | block: ".Block" 13 | front: "Front" 14 | back: "Back" 15 | side: "Side" 16 | inset: "Inset" 17 | 18 | languages: 19 | en: English 20 | nl: Nederlands 21 | 22 | measurements: 23 | hipsCircumference: 985 24 | upperLegCircumference: 630 25 | hipsToUpperLeg: 220 26 | 27 | options: 28 | # fit group 29 | elasticWidth: 30 | title: "Elastic width" 31 | description: "Width of the elastic band you intend to use." 32 | group: "fit" 33 | type: "measure" 34 | min: 10 35 | max: 70 36 | default: 35 37 | bulge: 38 | title: "Bulge" 39 | description: "Increase angle to create more room in the front pouch." 40 | group: "fit" 41 | type: "angle" 42 | min: 0 43 | max: 40 44 | default: 20 45 | legBonus: 46 | title: "Leg length bonus" 47 | description: "Extra length to add to the legs." 48 | group: "fit" 49 | type: "measure" 50 | min: 0 51 | max: 70 52 | default: 0 53 | rise: 54 | title: "Rise" 55 | description: "Amount to raise the waist. A negative value will lower it." 56 | group: "fit" 57 | type: "measure" 58 | min: -30 59 | max: 100 60 | default: 35 61 | 62 | # advanced group 63 | stretch: 64 | title: "Stretch" 65 | description: "The amount of negative ease." 66 | group: "advanced" 67 | type: "percent" 68 | min: 4 69 | max: 24 70 | default: 14 71 | legStretch: 72 | title: "Leg stretch" 73 | description: "For best results, you want to fit your legs a but more snugly — say no to gaping." 74 | group: "advanced" 75 | type: "percent" 76 | min: 25 77 | max: 45 78 | default: 40 79 | backRise: 80 | title: "Back rise" 81 | description: "Percentage by which the waist will be raised at the back." 82 | group: "advanced" 83 | type: "percent" 84 | min: 0 85 | max: 5 86 | default: 2.5 87 | -------------------------------------------------------------------------------- /patterns/Core/BruceBoxerBriefs/sampler/models.yml: -------------------------------------------------------------------------------- 1 | default: 2 | group: maleStandardUsSizes 3 | groups: 4 | realMen: 5 | - joost 6 | maleStandardUsSizes: 7 | - usSize34 8 | - usSize36 9 | - usSize38 10 | - usSize40 11 | - usSize42 12 | - usSize44 13 | measurements: 14 | hipsCircumference: 15 | joost : 960 16 | usSize34: 722 17 | usSize36: 780 18 | usSize38: 838 19 | usSize40: 896 20 | usSize42: 954 21 | usSize44: 1012 22 | upperLegCircumference: 23 | joost : 600 24 | usSize34: 520 25 | usSize36: 540 26 | usSize38: 560 27 | usSize40: 580 28 | usSize42: 600 29 | usSize44: 620 30 | hipsToUpperLeg: 31 | joost : 220 32 | usSize34: 180 33 | usSize36: 190 34 | usSize38: 200 35 | usSize40: 210 36 | usSize42: 220 37 | usSize44: 230 38 | -------------------------------------------------------------------------------- /patterns/Core/BruceBoxerBriefs/translations/messages.en.yml: -------------------------------------------------------------------------------- 1 | "Inset": "Inset" 2 | "Front side": "Front side" 3 | "Back side": "Back side" 4 | -------------------------------------------------------------------------------- /patterns/Core/BruceBoxerBriefs/translations/messages.nl.yml: -------------------------------------------------------------------------------- 1 | "Inset": "Inzet" 2 | "Front side": "Voorzijde" 3 | "Back side": "Achterzijde" 4 | 5 | -------------------------------------------------------------------------------- /patterns/Core/CathrinCorset/sampler/models.yml: -------------------------------------------------------------------------------- 1 | default: 2 | group: realWomen 3 | groups: 4 | realWomen: 5 | - cathrin 6 | - sorcha 7 | measurements: 8 | underBust: 9 | cathrin: 720 10 | sorcha : 730 11 | naturalWaist: 12 | cathrin: 640 13 | sorcha : 840 14 | hipsCircumference: 15 | cathrin: 800 16 | sorcha : 1000 17 | naturalWaistToUnderbust: 18 | cathrin: 100 19 | sorcha : 90 20 | naturalWaistToHip: 21 | cathrin: 160 22 | sorcha : 200 23 | -------------------------------------------------------------------------------- /patterns/Core/CathrinCorset/translations/messages.en.yml: -------------------------------------------------------------------------------- 1 | "Panel": "Panel" 2 | -------------------------------------------------------------------------------- /patterns/Core/CathrinCorset/translations/messages.fr.yml: -------------------------------------------------------------------------------- 1 | "Panel": "Panneau" 2 | -------------------------------------------------------------------------------- /patterns/Core/CathrinCorset/translations/messages.nl.yml: -------------------------------------------------------------------------------- 1 | "Panel": "Paneel" 2 | -------------------------------------------------------------------------------- /patterns/Core/HugoHoodie/sampler/models.yml: -------------------------------------------------------------------------------- 1 | measurements: 2 | headCircumference: 3 | joost : 590 4 | usSize34: 564 5 | usSize36: 567 6 | usSize38: 570 7 | usSize40: 573 8 | usSize42: 576 9 | usSize44: 579 10 | -------------------------------------------------------------------------------- /patterns/Core/HugoHoodie/translations/messages.de.yml: -------------------------------------------------------------------------------- 1 | "Cuff": "Ärmelbund" 2 | "Hood center": "Kapuze Mittelstreifen" 3 | "Hood side": "Kapuze Seitenteil" 4 | "Neck binding": "Halsverblendung" 5 | "Pocket facing": "Taschenbeleg" 6 | "Pocket": "Tasche" 7 | "Sleeve": "Ärmel" 8 | "Waistband": "Bund" 9 | -------------------------------------------------------------------------------- /patterns/Core/HugoHoodie/translations/messages.en.yml: -------------------------------------------------------------------------------- 1 | "Cuff": "Cuff" 2 | "Hood center": "Hood center" 3 | "Hood side": "Hood side" 4 | "Neck binding": "Neck binding" 5 | "Pocket facing": "Pocket facing" 6 | "Pocket": "Pocket" 7 | "Sleeve": "Sleeve" 8 | "Waistband": "Waistband" 9 | -------------------------------------------------------------------------------- /patterns/Core/HugoHoodie/translations/messages.fr.yml: -------------------------------------------------------------------------------- 1 | "Cuff": "Manchette" 2 | "Hood center": "Capuche centrale" 3 | "Hood side": "Capuche latérale" 4 | "Neck binding": "Reliure de l'encolure" 5 | "Pocket facing": "Parementure de poche" 6 | "Pocket": "Poche" 7 | "Sleeve": "Manche" 8 | "Waistband": "Ceinture" 9 | -------------------------------------------------------------------------------- /patterns/Core/HugoHoodie/translations/messages.nl.yml: -------------------------------------------------------------------------------- 1 | "Cuff": "Manchet" 2 | "Hood center": "Middendeel kap" 3 | "Hood side": "Zijdeel kap" 4 | "Neck binding": "Band halsopening" 5 | "Pocket facing": "Zak doublure" 6 | "Pocket": "Zak" 7 | "Sleeve": "Mouw" 8 | "Waistband": "Tailleband" 9 | -------------------------------------------------------------------------------- /patterns/Core/Pattern/translations/messages.de.yml: -------------------------------------------------------------------------------- 1 | "Back": "Rückenteil" 2 | "Curve length": "Kurvenlänge" 3 | "Cut on fold": "Im Stoffbruch zuschneiden" 4 | "from fabric": "aus dem Hauptstoff" 5 | "from interfacing": "from interfacing" 6 | "from lining": "aus dem Futterstoff" 7 | "from ribbing": "aus der Bündchenware" 8 | "Front": "Vorderteil" 9 | "Good sides together": "Stoffaußenseiten zusammen" 10 | "Grainline": "Fadenverlauf" 11 | "Hem allowance": "Saumzugabe" 12 | "length": "Höhe" 13 | "No\nseam\nallowance": "Keine\nNahtzugabe" 14 | "Seam length": "Nahtlänge" 15 | "Standard\nseam\nallowance": "Standard\nNahtzugabe" 16 | "width": "Weite" 17 | -------------------------------------------------------------------------------- /patterns/Core/Pattern/translations/messages.en.yml: -------------------------------------------------------------------------------- 1 | "Back": "Back" 2 | "Front": "Front" 3 | "Side": "Side" 4 | "Sleeve": "Sleeve" 5 | "Curve length": "Curve length" 6 | "Cut on fold": "Cut on fold" 7 | "from fabric": "from main fabric" 8 | "from interfacing": "from interfacing" 9 | "from lining": "from lining" 10 | "from ribbing": "from ribbing" 11 | "Good sides together": "Good sides together" 12 | "Grainline": "Grainline" 13 | "Hem allowance": "Hem allowance" 14 | "length": "length" 15 | "No\nseam\nallowance": "No\nseam\nallowance" 16 | "Seam length": "Seam length" 17 | "Standard\nseam\nallowance": "Standard\nseam\nallowance" 18 | "width": "width" 19 | -------------------------------------------------------------------------------- /patterns/Core/Pattern/translations/messages.fr.yml: -------------------------------------------------------------------------------- 1 | "Back": "Dos" 2 | "Curve length": "Longueur de la courbe" 3 | "Cut on fold": "Couper sur la pliure" 4 | "from fabric": "à partir du tissu principal" 5 | "from interfacing": "à partir de tissue d'entoilage" 6 | "from lining": "à partir de tissu de doublure" 7 | "from ribbing": "à partir de tissu côtelé" 8 | "Front": "Devant" 9 | "Good sides together": "Côtés endroits ensemble" 10 | "Grainline": "Droit fil" 11 | "Hem allowance": "Marge d'ourlet" 12 | "length": "longueur" 13 | "No\nseam\nallowance": "Aucune\nmarge\nde couture" 14 | "Seam length": "Longeur de couture" 15 | "Standard\nseam\nallowance": "Marge\nde couture\nstandard" 16 | "width": "largeur" 17 | -------------------------------------------------------------------------------- /patterns/Core/Pattern/translations/messages.nl.yml: -------------------------------------------------------------------------------- 1 | "Back": "Rug" 2 | "Front": "Voorzijde" 3 | "Side": "Zijkant" 4 | "Sleeve": "Mouw" 5 | "Curve length": "Lengte curve" 6 | "Cut on fold": "Knippen op stofvouw" 7 | "from fabric": "uit de hoofd stof" 8 | "from interfacing": "uit interfacing" 9 | "from lining": "uit voering" 10 | "from ribbing": "uit ribbing" 11 | "Good sides together": "Met de goede stofkant tegen elkaar" 12 | "Grainline": "Draadrichting" 13 | "Hem allowance": "Zoom naadwaarde" 14 | "length": "lengte" 15 | "No\nseam\nallowance": "Zonder\nnaadwaarde" 16 | "Seam length": "Naad lengte" 17 | "Standard\nseam\nallowance": "Standaard\nnaadwaarde" 18 | "width": "breedte" 19 | -------------------------------------------------------------------------------- /patterns/Core/SimonShirt/sampler/models.yml: -------------------------------------------------------------------------------- 1 | measurements: 2 | naturalWaist: 3 | joost : 885 4 | usSize34: 697 5 | usSize36: 755 6 | usSize38: 813 7 | usSize40: 871 8 | usSize42: 929 9 | usSize44: 987 10 | -------------------------------------------------------------------------------- /patterns/Core/SvenSweatshirt/sampler/models.yml: -------------------------------------------------------------------------------- 1 | measurements: 2 | naturalWaist: 3 | joost : 885 4 | usSize34: 697 5 | usSize36: 755 6 | usSize38: 813 7 | usSize40: 871 8 | usSize42: 929 9 | usSize44: 987 10 | -------------------------------------------------------------------------------- /patterns/Core/TamikoTop/config.yml: -------------------------------------------------------------------------------- 1 | info: 2 | name: "Tamiko Top" 3 | description: "Tamiko is a zero-waste top." 4 | handle: "tamiko" 5 | level: 2 6 | tags: 7 | - womenswear 8 | - menswear 9 | - top 10 | 11 | parts: 12 | top: "Tamiko Top" 13 | 14 | languages: 15 | en: English 16 | nl: Nederlands 17 | 18 | measurements: 19 | shoulderToShoulder: 380 20 | chestCircumference: 1050 21 | centerBackNeckToWaist: 365 22 | naturalWaistToHip: 260 23 | 24 | options: 25 | lengthBonus: 26 | title: "Length bonus" 27 | description: "The amount to lengthen the garment. A negative value will shorten it." 28 | group: "style" 29 | type: "measure" 30 | min: -150 31 | max: 350 32 | default: 0 33 | -------------------------------------------------------------------------------- /patterns/Core/TamikoTop/sampler/models.yml: -------------------------------------------------------------------------------- 1 | default: 2 | group: realWomen 3 | 4 | groups: 5 | realWomen: 6 | - sorcha 7 | 8 | measurements: 9 | chestCircumference: 10 | sorcha: 1050 11 | centerBackNeckToWaist: 12 | sorcha: 365 13 | naturalWaistToHip: 14 | sorcha: 260 15 | shoulderToShoulder: 16 | sorcha: 380 17 | 18 | -------------------------------------------------------------------------------- /patterns/Core/TheoTrousers/TheoTrousers.php: -------------------------------------------------------------------------------- 1 | 11 | * @copyright 2016 Joost De Cock 12 | * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, Version 3 13 | */ 14 | class TheoTrousers extends TheodoreTrousers 15 | { 16 | /* 17 | ___ _ _ _ _ _ 18 | |_ _|_ __ (_) |_(_) __ _| (_)___ ___ 19 | | || '_ \| | __| |/ _` | | / __|/ _ \ 20 | | || | | | | |_| | (_| | | \__ \ __/ 21 | |___|_| |_|_|\__|_|\__,_|_|_|___/\___| 22 | 23 | Things we need to do before we can draft a pattern 24 | */ 25 | 26 | /** 27 | * Sets up options and values for our draft 28 | * 29 | * By branching this out of the sample/draft methods, we can 30 | * set a bunch of options and values the influence the draft 31 | * without having to touch the sample/draft methods 32 | * When extending this pattern so we can just implement the 33 | * initialize() method and re-use the other methods. 34 | * 35 | * Good to know: 36 | * Options are typically provided by the user, but sometimes they are fixed 37 | * Values are calculated for re-use later 38 | * 39 | * @param \Freesewing\Model $model The model to sample for 40 | * 41 | * @return void 42 | */ 43 | public function initialize($model) 44 | { 45 | // Prevent missing sa from causing warnings 46 | $this->setOptionIfUnset('sa', 0); 47 | 48 | // This option is fixed in the legacy code 49 | $this->setOptionIfUnset('trouserBottomWidth', 226); 50 | 51 | // Specific to the Theo pattern 52 | $this->setValue('legReduction', 30); 53 | $this->setValue('frontReduction', 10); 54 | $this->setValue('backReduction', 15); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /patterns/Core/TheoTrousers/config.yml: -------------------------------------------------------------------------------- 1 | info: 2 | name: "Theo trousers" 3 | description: "Theo is Theodore with a more slim cut." 4 | handle: "theo" 5 | level: 8 6 | tags: 7 | - menswear 8 | - trousers 9 | - bottom 10 | 11 | parts: 12 | back: "Back" 13 | front: "Front" 14 | waistbandInterfacingLeft: "Waistband interfacing left" 15 | waistbandInterfacingRight: "Waistband interfacing right" 16 | waistbandLeft: "Waistband left" 17 | waistbandRight: "Waistband right" 18 | waistbandLiningLeft: "Waistband lining left" 19 | waistbandLiningRight: "Waistband lining right" 20 | flyPiece: "Fly piece" 21 | flyShield: "Fly shield" 22 | sidePiece: "Side piece" 23 | frontPocketBag: "Front pocket bag" 24 | backInnerPocketBag: "Back inner pocket bag" 25 | backOuterPocketBag: "Back outer pocket bag" 26 | backPocketFacing: "Back pocket facing" 27 | backPocketInterfacing: "Back pocket interfacing" 28 | beltLoop: "Belt loop" 29 | 30 | languages: 31 | en: "English" 32 | nl: "Nederlands" 33 | de: "Deutsch" 34 | 35 | measurements: 36 | hipsCircumference: 950 37 | seatCircumference: 1045 38 | inseam: 910 39 | seatDepth: 200 40 | options: 41 | waistbandWidth: 42 | title: "Waistband width" 43 | description: "The width of the waistband." 44 | group: "fit" 45 | type: "measure" 46 | min: -10 47 | max: 60 48 | default: 40 49 | backRise: 50 | title: "Back rise" 51 | description: "The amount by which to raise the back." 52 | group: "fit" 53 | type: "measure" 54 | min: 0 55 | max: 60 56 | default: 40 57 | lengthBonus: 58 | title: "Length bonus" 59 | description: "The amount to lengthen the garment. A negative value will shorten it." 60 | group: "fit" 61 | type: "measure" 62 | min: -60 63 | max: 80 64 | default: 40 65 | -------------------------------------------------------------------------------- /patterns/Core/TheodoreTrousers/config.yml: -------------------------------------------------------------------------------- 1 | info: 2 | name: "Theodore trousers" 3 | description: "Thedore are classic trousers by the (Aldrich) book." 4 | handle: "theodore" 5 | level: 8 6 | tags: 7 | - menswear 8 | - trousers 9 | - bottom 10 | 11 | parts: 12 | back: "Back" 13 | front: "Front" 14 | waistbandInterfacingLeft: "Waistband interfacing left" 15 | waistbandInterfacingRight: "Waistband interfacing right" 16 | waistbandLeft: "Waistband left" 17 | waistbandRight: "Waistband right" 18 | waistbandLiningLeft: "Waistband lining left" 19 | waistbandLiningRight: "Waistband lining right" 20 | flyPiece: "Fly piece" 21 | flyShield: "Fly shield" 22 | sidePiece: "Side piece" 23 | frontPocketBag: "Front pocket bag" 24 | backInnerPocketBag: "Back inner pocket bag" 25 | backOuterPocketBag: "Back outer pocket bag" 26 | backPocketFacing: "Back pocket facing" 27 | backPocketInterfacing: "Back pocket interfacing" 28 | beltLoop: "Belt loop" 29 | 30 | languages: 31 | en: "English" 32 | nl: "Nederlands" 33 | de: "Deutsch" 34 | 35 | measurements: 36 | hipsCircumference: 950 37 | seatCircumference: 1045 38 | inseam: 910 39 | seatDepth: 200 40 | 41 | options: 42 | waistbandWidth: 43 | title: "Waistband width" 44 | description: "The width of the waistband." 45 | group: "fit" 46 | type: "measure" 47 | min: 20 48 | max: 60 49 | default: 40 50 | backRise: 51 | title: "Back rise" 52 | description: "The amount by which to raise the back." 53 | group: "fit" 54 | type: "measure" 55 | min: 0 56 | max: 60 57 | default: 40 58 | lengthBonus: 59 | title: "Length bonus" 60 | description: "The amount to lengthen the garment. A negative value will shorten it." 61 | group: "fit" 62 | type: "measure" 63 | min: -60 64 | max: 80 65 | default: 0 66 | -------------------------------------------------------------------------------- /patterns/Core/TheodoreTrousers/sampler/models.yml: -------------------------------------------------------------------------------- 1 | default: 2 | group: maleStandardUsSizes 3 | groups: 4 | realMen: 5 | - joost 6 | maleStandardUsSizes: 7 | - usSize34 8 | - usSize36 9 | - usSize38 10 | - usSize40 11 | - usSize42 12 | - usSize44 13 | measurements: 14 | hipsCircumference: 15 | joost : 950 16 | usSize34: 950 17 | usSize36: 950 18 | usSize38: 950 19 | usSize40: 950 20 | usSize42: 950 21 | usSize44: 950 22 | seatCircumference: 23 | joost : 1045 24 | usSize34: 1045 25 | usSize36: 1045 26 | usSize38: 1045 27 | usSize40: 1045 28 | usSize42: 1045 29 | usSize44: 1045 30 | inseam: 31 | joost : 910 32 | usSize34: 910 33 | usSize36: 910 34 | usSize38: 910 35 | usSize40: 910 36 | usSize42: 910 37 | usSize44: 910 38 | seatDepth: 39 | joost : 200 40 | usSize34: 200 41 | usSize36: 200 42 | usSize38: 200 43 | usSize40: 200 44 | usSize42: 200 45 | usSize44: 200 46 | -------------------------------------------------------------------------------- /patterns/Core/TrayvonTie/config.yml: -------------------------------------------------------------------------------- 1 | info: 2 | name: "Trayvon Tie" 3 | description: "Trayvon is a tie that cuts no corners for a professional result." 4 | handle: "trayvon" 5 | level: 3 6 | tags: 7 | - accessories 8 | 9 | inMemoryOf: 10 | name: "Trayvon Martin" 11 | link: "https://en.wikipedia.org/wiki/Trayvon_Martin" 12 | 13 | parts: 14 | interfacingTip: "Interfacing tip" 15 | interfacingTail: "Interfacing tail" 16 | fabricTip: "Fabric tip" 17 | fabricTail: "Fabric tail" 18 | liningTip: "Lining tip" 19 | liningTail: "Lining tail" 20 | loop: "Loop" 21 | 22 | languages: 23 | en: English 24 | nl: Nederlands 25 | fr: French 26 | 27 | measurements: 28 | centerBackNeckToWaist: 480 29 | neckCircumference: 420 30 | 31 | options: 32 | tipWidth: 33 | title: "Tip width" 34 | description: "The width of the tie at the tip." 35 | group: "style" 36 | type: measure 37 | min: 20 38 | max: 120 39 | default: 60 40 | knotWidth: 41 | title: "Knot width" 42 | description: "The width of the tie at the knot/middle." 43 | group: "style" 44 | type: measure 45 | min: 20 46 | max: 70 47 | default: 35 48 | 49 | -------------------------------------------------------------------------------- /patterns/Core/TrayvonTie/sampler/models.yml: -------------------------------------------------------------------------------- 1 | default: 2 | group: maleStandardUsSizes 3 | groups: 4 | realMen: 5 | - joost 6 | maleStandardUsSizes: 7 | - usSize34 8 | - usSize36 9 | - usSize38 10 | - usSize40 11 | - usSize42 12 | - usSize44 13 | measurements: 14 | centerBackNeckToWaist: 15 | joost : 480 16 | usSize34: 489 17 | usSize36: 492 18 | usSize38: 495 19 | usSize40: 498 20 | usSize42: 501 21 | usSize44: 505 22 | neckCircumference: 23 | joost : 420 24 | usSize34: 366 25 | usSize36: 378 26 | usSize38: 391 27 | usSize40: 404 28 | usSize42: 416 29 | usSize44: 429 30 | -------------------------------------------------------------------------------- /patterns/Core/TrayvonTie/translations/messages.en.yml: -------------------------------------------------------------------------------- 1 | "Fabric tail": "Fabric tail" 2 | "Fabric tip": "Fabric tip" 3 | "from tie interfacing": "from tie interfacing" 4 | "Interfacing tail": "Interfacing tail" 5 | "Interfacing tip": "Interfacing tip" 6 | "Lining tail": "Lining tail" 7 | "Lining tip": "Lining tip" 8 | "Loop": "Loop" 9 | -------------------------------------------------------------------------------- /patterns/Core/TrayvonTie/translations/messages.fr.yml: -------------------------------------------------------------------------------- 1 | "Fabric tail": "Queue du tissu" 2 | "Fabric tip": "Pointe du tissu" 3 | "from tie interfacing": "à partir de tissu d'entoilage pour cravate" 4 | "Interfacing tail": "Queue de l'entoilage" 5 | "Interfacing tip": "Bout de l'entoilage" 6 | "Lining tail": "Queue de la doublure" 7 | "Lining tip": "Pointe de la doublure" 8 | "Loop": "Boucle" 9 | -------------------------------------------------------------------------------- /patterns/Core/TrayvonTie/translations/messages.nl.yml: -------------------------------------------------------------------------------- 1 | "Fabric tail": "Stof staart" 2 | "Fabric tip": "Stof punt" 3 | "from tie interfacing": "uit stropdas interfacing" 4 | "Interfacing tail": "Interfacing staart" 5 | "Interfacing tip": "Interfacing punt" 6 | "Lining tail": "Voering staart" 7 | "Lining tip": "Voering punt" 8 | "Loop": "Lus" 9 | -------------------------------------------------------------------------------- /patterns/Core/WahidWaistcoat/sampler/models.yml: -------------------------------------------------------------------------------- 1 | measurements: 2 | naturalWaist: 3 | joost : 885 4 | usSize34: 697 5 | usSize36: 755 6 | usSize38: 813 7 | usSize40: 871 8 | usSize42: 929 9 | usSize44: 987 10 | -------------------------------------------------------------------------------- /patterns/Docs/ClassDocs/config.yml: -------------------------------------------------------------------------------- 1 | hidden: true 2 | info: 3 | name: "Class documentation" 4 | version: "1.0" 5 | date: 20170130 6 | author: "Joost De Cock" 7 | email: "joost@decock.org" 8 | company: "freesewing.org" 9 | handle: "classdocs" 10 | parts: 11 | part: "A part" 12 | 13 | languages: 14 | en: "English" 15 | 16 | measurements: 17 | exampleMeasurement: 520 18 | 19 | options: 20 | class: 21 | type: "chooseOne" 22 | default: "none" 23 | method: 24 | type: "chooseOne" 25 | default: "none" 26 | -------------------------------------------------------------------------------- /patterns/Docs/ClassDocs/sampler/models.yml: -------------------------------------------------------------------------------- 1 | measurements: 2 | naturalWaist: 3 | joost : 885 4 | usSize34: 697 5 | usSize36: 755 6 | usSize38: 813 7 | usSize40: 871 8 | usSize42: 929 9 | usSize44: 987 10 | -------------------------------------------------------------------------------- /patterns/Docs/DesignTutorial/config.yml: -------------------------------------------------------------------------------- 1 | hidden: true 2 | info: 3 | name: "Design Tutorial" 4 | author: "Joost De Cock" 5 | email: "joost@decock.org" 6 | company: "freesewing.org" 7 | 8 | parts: 9 | part: "Part" 10 | 11 | options: 12 | figure: 13 | type: "chooseOne" 14 | default: "none" 15 | 16 | -------------------------------------------------------------------------------- /patterns/Docs/DesignTutorial/sampler/models.yml: -------------------------------------------------------------------------------- 1 | measurements: 2 | naturalWaist: 3 | joost : 885 4 | usSize34: 697 5 | usSize36: 755 6 | usSize38: 813 7 | usSize40: 871 8 | usSize42: 929 9 | usSize44: 987 10 | -------------------------------------------------------------------------------- /patterns/Docs/DesignTutorial/translations/messages.en.yml: -------------------------------------------------------------------------------- 1 | "Baby bib": "Baby bib" 2 | "Attach snap at the back": "Attach snap at the back" 3 | "Finish with bias tape": "Finish with bias tape" 4 | 5 | -------------------------------------------------------------------------------- /patterns/Docs/DesignTutorial/translations/messages.nl.yml: -------------------------------------------------------------------------------- 1 | "Baby bib": "Baby slabber" 2 | "Attach snap at the back": "Drukknop vastmaken aan de achterkant" 3 | "Finish with bias tape": "Afwerken met biesband" 4 | 5 | -------------------------------------------------------------------------------- /patterns/Docs/NotationLegend/config.yml: -------------------------------------------------------------------------------- 1 | hidden: true 2 | info: 3 | name: "Pattern notation legend" 4 | version: "1.0" 5 | date: 20180818 6 | author: "Joost De Cock" 7 | email: "joost@decock.org" 8 | company: "freesewing.org" 9 | 10 | parts: 11 | part: "A part" 12 | 13 | languages: 14 | en: "English" 15 | 16 | measurements: 17 | exampleMeasurement: 520 18 | 19 | options: 20 | item: 21 | type: "chooseOne" 22 | default: "none" 23 | -------------------------------------------------------------------------------- /patterns/Templates/PatternTemplate/sampler/models.yml: -------------------------------------------------------------------------------- 1 | default: 2 | group: realMen 3 | groups: 4 | realMen: 5 | - joost 6 | measurements: 7 | naturalWaist: 8 | joost : 885 9 | usSize34: 697 10 | usSize36: 755 11 | usSize38: 813 12 | usSize40: 871 13 | usSize42: 929 14 | usSize44: 987 15 | -------------------------------------------------------------------------------- /patterns/Tests/TestPattern/TestPattern.php: -------------------------------------------------------------------------------- 1 | 15 | * @copyright 2017 Joost De Cock 16 | * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, Version 3 17 | */ 18 | class TestPattern extends Pattern 19 | { 20 | /** 21 | * The mandatory draft method 22 | * 23 | * @param \Freesewing\Model $model The model to draft for 24 | * 25 | * @return void 26 | */ 27 | public function draft($model) 28 | { 29 | 30 | } 31 | 32 | /** 33 | * The mandatory sample method 34 | * 35 | * @param \Freesewing\Model $model The model to sample for 36 | * 37 | * @return void 38 | */ 39 | public function sample($model) 40 | { 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /patterns/Tests/TestPattern/config.yml: -------------------------------------------------------------------------------- 1 | hidden: true 2 | info: 3 | name: "Test Pattern" 4 | version: "1.0" 5 | date: 20170118 6 | author: "Joost De Cock" 7 | email: "joost@decock.org" 8 | company: "freesewing.org" 9 | 10 | parts: 11 | testPart: "Test Part" 12 | 13 | measurements: 14 | someMeasurement: 200 15 | 16 | options: 17 | measureOption: 18 | type: "measure" 19 | min: 10 20 | max: 50 21 | default: 30 22 | angleOption: 23 | type: "angle" 24 | default: 45 25 | min: 10 26 | max: 50 27 | percentOption: 28 | type: "percent" 29 | default: 50 30 | min: 10 31 | max: 50 32 | chooseOneOption: 33 | type: "chooseOne" 34 | options: 35 | 1: "Option 1" 36 | 2: "Option 2" 37 | default: 1 38 | -------------------------------------------------------------------------------- /patterns/Tests/TestPattern/sampler/models.yml: -------------------------------------------------------------------------------- 1 | default: 2 | group: someGroup 3 | groups: 4 | someGroup: 5 | - someModel 6 | anotherGroup: 7 | - anotherModel 8 | measurements: 9 | someMeasurement: 10 | someModel : 123 11 | anotherModel : 321 12 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | tests 10 | 11 | 12 | 13 | 14 | ./src 15 | ./channels 16 | ./themes 17 | ./patterns/Core/Pattern/Pattern.php 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /scripts/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Starting deploy script" 3 | if [ -z "$TRAVIS_PULL_REQUEST" ]; then 4 | echo "Pull request, not deploying."; 5 | exit 6 | else 7 | if [ "$TRAVIS_BRANCH" = "develop" ] || [ "$TRAVIS_BRANCH" = "master" ]; then 8 | if [ "$TRAVIS_PHP_VERSION" = "7.0" ]; then 9 | echo "Deploying PHP version $TRAVIS_PHP_VERSION build."; 10 | cd $TRAVIS_BUILD_DIR 11 | if [ "$TRAVIS_BRANCH" = "master" ]; then 12 | echo "Enabling bail" 13 | sed -i "s#bail_enabled: false#bail_enabled: true#g" config.yml 14 | fi 15 | mkdir build 16 | mv channels src themes patterns vendor index.php config.yml build/ 17 | tar -czf freesewing.tgz build 18 | export SSHPASS=$DEPLOY_PASS 19 | sshpass -e scp -o stricthostkeychecking=no freesewing.tgz $DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PATH/$TRAVIS_BRANCH/builds 20 | sshpass -e ssh -o stricthostkeychecking=no $DEPLOY_USER@$DEPLOY_HOST "cd /fs/deploy/core/$TRAVIS_BRANCH/builds ; tar -xzf freesewing.tgz ; rm freesewing.tgz ; rm -rf previous ; mv current previous ; mv build current " 21 | echo "All done."; 22 | else 23 | echo "Build on PHP version $TRAVIS_PHP_VERSION, not deploying."; 24 | fi 25 | else 26 | echo "Branch is neither master nor develop, not deploying." 27 | fi 28 | fi 29 | echo "Bye" 30 | -------------------------------------------------------------------------------- /scripts/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DIR="$(dirname "${BASH_SOURCE[0]}")" 3 | cd $DIR 4 | php ./test.php 5 | -------------------------------------------------------------------------------- /scripts/testall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DIR="$(dirname "${BASH_SOURCE[0]}")" 3 | cd $DIR 4 | php ./testall.php 5 | -------------------------------------------------------------------------------- /src/Boundary/Boundary.php: -------------------------------------------------------------------------------- 1 | 11 | * @copyright 2016 Joost De Cock 12 | * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, Version 3 13 | */ 14 | class Boundary 15 | { 16 | /** @var \Freesewing\Point topLeft Top-left point of the boundary */ 17 | public $topLeft; 18 | 19 | /** @var \Freesewing\Point bottomRight Bottom-right point of the boundary */ 20 | public $bottomRight; 21 | 22 | /** @var float width Width of the boundary */ 23 | public $width; 24 | 25 | /** @var float height Height of the boundary */ 26 | public $height; 27 | 28 | /** 29 | * Sets the topLeft property and updates width and height. 30 | * 31 | * @param \Freesewing\Point point 32 | */ 33 | public function setTopLeft($point) 34 | { 35 | $this->topLeft = $point; 36 | $this->updateDimensions(); 37 | } 38 | 39 | /** 40 | * Sets the bottomRight property and updates width and height. 41 | * 42 | * @param \Freesewing\Point point 43 | */ 44 | public function setBottomRight($point) 45 | { 46 | $this->bottomRight = $point; 47 | $this->updateDimensions(); 48 | } 49 | 50 | /** 51 | * Returns the topLeft property. 52 | * 53 | * @return \Freesewing\Point 54 | */ 55 | public function getTopLeft() 56 | { 57 | return $this->topLeft; 58 | } 59 | 60 | /** 61 | * Returns the bottomRight property. 62 | * 63 | * @return \Freesewing\Point 64 | */ 65 | public function getBottomRight() 66 | { 67 | return $this->bottomRight; 68 | } 69 | 70 | /** 71 | * Calculates boundary dimensions and updates width and height properties. 72 | */ 73 | private function updateDimensions() 74 | { 75 | if (is_object($this->topLeft) && is_object($this->bottomRight)) { 76 | $this->width = round($this->bottomRight->getX() - $this->topLeft->getX(),3); 77 | $this->height = round($this->bottomRight->y - $this->topLeft->y,3); 78 | if ($this->height > $this->width) { 79 | $this->maxSize = $this->height; 80 | } else { 81 | $this->maxSize = $this->width; 82 | } 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /src/Coords/Coords.php: -------------------------------------------------------------------------------- 1 | 12 | * @copyright 2016 Joost De Cock 13 | * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, Version 3 14 | */ 15 | abstract class Coords 16 | { 17 | /** * @var float $x X-coordinate */ 18 | public $x = null; 19 | 20 | /** @var float $y Y-coordinate */ 21 | public $y = null; 22 | 23 | /** 24 | * Sets the X-coordinate 25 | * 26 | * @param float $x The value to set 27 | */ 28 | public function setX($x) 29 | { 30 | if (is_numeric($x)) { 31 | $this->x = $x; 32 | } else { 33 | $x = 0; 34 | } 35 | } 36 | /** 37 | * Sets the Y-coordinate 38 | * 39 | * @param float $y The value to set 40 | */ 41 | public function setY($y) 42 | { 43 | if (is_numeric($y)) { 44 | $this->y = $y; 45 | } else { 46 | $y = 0; 47 | } 48 | } 49 | 50 | /** 51 | * Returns the X-coordinate 52 | * 53 | * @return float The X-coordinate 54 | */ 55 | public function getX() 56 | { 57 | return $this->x; 58 | } 59 | 60 | /** 61 | * Returns the Y-coordinate 62 | * 63 | * @return float The Y-coordinate 64 | */ 65 | public function getY() 66 | { 67 | return $this->y; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/Dimension/Dimension.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2016 Joost De Cock 14 | * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, Version 3 15 | */ 16 | class Dimension 17 | { 18 | /** @var \Freesewing\TextOnPath $label The label for the dimension */ 19 | private $label; 20 | 21 | /** @var array $leaders Array of leader lines/paths for the dimension */ 22 | private $leaders = array(); 23 | 24 | /** 25 | * Sets the label property 26 | * 27 | * @param \Freesewing\TextOnPath $label The label for the dimension 28 | */ 29 | public function setLabel(\Freesewing\TextOnPath $label) 30 | { 31 | $this->label = $label; 32 | } 33 | 34 | /** 35 | * Sets the leaders property 36 | * 37 | * @param array $leaders Array of leaders 38 | */ 39 | public function setLeaders($leaders) 40 | { 41 | $this->leaders = $leaders; 42 | } 43 | 44 | /** 45 | * Gets the label property 46 | * 47 | * @return \Freesewing\TextOnPath The label for the dimension 48 | */ 49 | public function getLabel() 50 | { 51 | return $this->label; 52 | } 53 | 54 | /** 55 | * Gets the leaders property 56 | * 57 | * @return array The leaders 58 | */ 59 | public function getLeaders() 60 | { 61 | return $this->leaders; 62 | } 63 | 64 | /** 65 | * Gets the path from the label 66 | * 67 | * @return \Freesewing\Path The label path 68 | */ 69 | public function getPath() 70 | { 71 | return $this->label->getPath(); 72 | } 73 | 74 | /** 75 | * Adds a leader to the leaders property 76 | * 77 | * @param \Freesewing\Path $leader A leader 78 | */ 79 | public function addLeader(\Freesewing\Path $leader) 80 | { 81 | $this->leaders[] = $leader; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /src/LayoutBlock/LayoutBlock.php: -------------------------------------------------------------------------------- 1 | 11 | * @copyright 2016 Joost De Cock 12 | * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, Version 3 13 | */ 14 | class LayoutBlock 15 | { 16 | /** @var float x Position X-value */ 17 | public $x = null; 18 | 19 | /** @var float y Postition Y-value */ 20 | public $y = null; 21 | 22 | /** @var float w Width */ 23 | public $w = null; 24 | 25 | /** @var float h Height */ 26 | public $h = null; 27 | 28 | /** @var bool used Whether this block is in use or not */ 29 | private $used = false; 30 | 31 | /** 32 | * Sets the position 33 | * 34 | * @param float x Position X-value 35 | * @param float y Position Y-value 36 | */ 37 | public function setPosition($x, $y) 38 | { 39 | $this->x = $x; 40 | $this->y = $y; 41 | } 42 | 43 | /** 44 | * Sets the size 45 | * 46 | * @param float w Width 47 | * @param float h Height 48 | */ 49 | public function setSize($w, $h) 50 | { 51 | $this->w = $w; 52 | $this->h = $h; 53 | } 54 | 55 | /** 56 | * Sets whether the block is used or not 57 | * 58 | * @param bool used 59 | */ 60 | public function setUsed($used = true) 61 | { 62 | $this->used = $used; 63 | } 64 | /** 65 | * Return whether the block is used or not 66 | * 67 | * @return bool True if it's used, false if not 68 | */ 69 | public function isUsed() 70 | { 71 | if ($this->used === true) { 72 | return true; 73 | } else { 74 | return false; 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/Model/Model.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2016 Joost De Cock 14 | * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, Version 3 15 | */ 16 | class Model 17 | { 18 | 19 | /** @var array measurements */ 20 | private $measurements = array(); 21 | 22 | /** 23 | * Sets a measurement. 24 | * 25 | * @param string $key Measurement key in the array 26 | * @param float $value Measurement value 27 | */ 28 | public function setMeasurement($key, $value) 29 | { 30 | $this->measurements[$key] = $value; 31 | } 32 | 33 | /** 34 | * Gets a measurement. 35 | * 36 | * @param string $key The key in the measurements array 37 | * 38 | * @return float The measurement value 39 | */ 40 | public function getMeasurement($key) 41 | { 42 | return $this->measurements[$key]; 43 | } 44 | 45 | /** 46 | * Alias for getMeasurement() 47 | * 48 | * @param string $key The key in the measurements array 49 | * 50 | * @return float The measurement value 51 | */ 52 | public function m($key) 53 | { 54 | return $this->getMeasurement($key); 55 | } 56 | 57 | /** 58 | * Adds measurements. 59 | * 60 | * Rater than adding measurements individually, this adds 61 | * an array of measurements. 62 | * 63 | * @param array $measurements 64 | */ 65 | public function addMeasurements($measurements) 66 | { 67 | if (is_array($measurements)) { 68 | foreach ($measurements as $key => $value) { 69 | $this->measurements[$key] = $value; 70 | } 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/Note/Note.php: -------------------------------------------------------------------------------- 1 | 16 | * @copyright 2016-2017 Joost De Cock 17 | * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, Version 3 18 | */ 19 | class Note extends Text 20 | { 21 | /** @var array Path of the arrow */ 22 | public $path; 23 | 24 | /** 25 | * Sets the path that the arrow follows. 26 | * 27 | * @param \Freesewing\Path path 28 | */ 29 | public function setPath(\Freesewing\Path $path) 30 | { 31 | $this->path = $path; 32 | } 33 | 34 | /** 35 | * Returns the path that the arrow follows. 36 | * 37 | * @return \Freesewing\Path 38 | */ 39 | public function getPath() 40 | { 41 | return $this->path; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/Packer/Packer.php: -------------------------------------------------------------------------------- 1 | 12 | * @copyright 2016 Joost De Cock 13 | * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, Version 3 14 | */ 15 | abstract class Packer 16 | { 17 | /** 18 | * Packers should implement the fit() method 19 | * 20 | * @param array List of blocks to fit 21 | */ 22 | abstract public function fit(&$blocks); 23 | } 24 | -------------------------------------------------------------------------------- /src/Point/Point.php: -------------------------------------------------------------------------------- 1 | 21 | * @copyright 2016 Joost De Cock 22 | * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, Version 3 23 | */ 24 | class Point extends Coords 25 | { 26 | /** Precision to round point coordinates on */ 27 | const PRECISION = 3; 28 | 29 | /** @var string $description Point description */ 30 | public $description = null; 31 | 32 | /** 33 | * Sets the X-coordinate for a point 34 | * 35 | * @param float $x The value to set 36 | */ 37 | public function setX($x) 38 | { 39 | if (is_numeric($x)) { 40 | $this->x = round($x, self::PRECISION); 41 | } else { 42 | $x = 0; 43 | } 44 | } 45 | 46 | /** 47 | * Sets the Y-coordinate for a point 48 | * 49 | * @param float $y The value to set 50 | */ 51 | public function setY($y) 52 | { 53 | if (is_numeric($y)) { 54 | $this->y = round($y, self::PRECISION); 55 | } else { 56 | $y = 0; 57 | } 58 | } 59 | 60 | /** 61 | * Sets the description property 62 | * 63 | * @param string $description The point description 64 | */ 65 | public function setDescription($description) 66 | { 67 | $this->description = $description; 68 | } 69 | 70 | /** 71 | * Returns the description property 72 | * 73 | * @return string The point description 74 | */ 75 | public function getDescription() 76 | { 77 | return $this->description; 78 | } 79 | 80 | /** 81 | * Returns point as vector object 82 | * 83 | * @return \Freesewing\Vector The new vector object 84 | */ 85 | public function asVector() 86 | { 87 | $vector = new \Freesewing\Vector(); 88 | $vector->setX($this->getX()); 89 | $vector->setY($this->getY()); 90 | 91 | return $vector; 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /src/Services/Service.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright 2016 Joost De Cock 10 | * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, Version 3 11 | */ 12 | abstract class Service 13 | { 14 | 15 | /** 16 | * Returns the name of the service 17 | * 18 | * This is used to load the default theme for the service when no theme is specified 19 | * 20 | * @see Context::loadTheme() 21 | * 22 | * @return string 23 | */ 24 | abstract public function getServiceName(); 25 | 26 | /** 27 | * @param \Freesewing\Context $context 28 | * 29 | * @return void 30 | */ 31 | abstract public function run(\Freesewing\Context $context); 32 | } 33 | -------------------------------------------------------------------------------- /src/Stack/Stack.php: -------------------------------------------------------------------------------- 1 | 15 | * @copyright 2016 Joost De Cock 16 | * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, Version 3 17 | */ 18 | class Stack 19 | { 20 | /** @var array $items Items on the stack */ 21 | public $items = array(); 22 | 23 | /** @var array $intersections Intersections on the stack */ 24 | public $intersections = array(); 25 | 26 | /** 27 | * Adds items to the stack 28 | * 29 | * @param array items The items to add 30 | */ 31 | public function push($items) 32 | { 33 | foreach ($items as $item) { 34 | $this->items[] = $item; 35 | } 36 | } 37 | 38 | /** 39 | * Adds intersection to the stack 40 | * 41 | * @param array $intersection The intersection to add 42 | */ 43 | public function addIntersection($intersection) 44 | { 45 | $this->intersections[] = $intersection; 46 | } 47 | 48 | /** 49 | * Replaces an item on the stack 50 | * 51 | * @param string $search The content of the item to replace 52 | * @param array $replace The replacement items 53 | */ 54 | public function replace($search, $replace) 55 | { 56 | $targetKey = false; 57 | foreach ($this->items as $key => $item) { 58 | if ($item == $search) { 59 | $targetKey = $key; 60 | } 61 | } 62 | if ($targetKey !== false) { 63 | array_splice($this->items, $targetKey, 1, $replace); 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/SvgAttributes/SvgAttributes.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright 2016 Joost De Cock 10 | * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, Version 3 11 | */ 12 | class SvgAttributes extends SvgBlock 13 | { 14 | /** 15 | * Returns the full svg tag 16 | * 17 | * Note that we are returning this as a string, 18 | * using the magic __toString() method 19 | * which is defined in the parent class 20 | * 21 | * @see \Freesewing\SvgBlock::__toString() 22 | * 23 | * @return string svg tag 24 | */ 25 | public function load() 26 | { 27 | return "\n\n"; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/SvgBlock/SvgBlock.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright 2016 Joost De Cock 10 | * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, Version 3 11 | */ 12 | abstract class SvgBlock 13 | { 14 | /** Classes extending this must implemen the load() method */ 15 | abstract public function load(); 16 | 17 | /** @var $data The data stored in the object */ 18 | private $data = false; 19 | 20 | /** 21 | * Triggered when object is used as a string 22 | * 23 | * @return string the data in the object as string 24 | */ 25 | public function __toString() 26 | { 27 | $data = ''; 28 | if (is_array($this->data)) { 29 | foreach ($this->data as $origin) { 30 | $data .= implode("\n ", $origin)." "; 31 | } 32 | } 33 | 34 | return $data; 35 | } 36 | 37 | /** 38 | * Returns the data property 39 | * 40 | * Actually, this is used to check whether data 41 | * has been added, because it returns false if not 42 | * 43 | * @return array $data The data in the object 44 | */ 45 | protected function getData() 46 | { 47 | return $this->data; 48 | } 49 | 50 | /** 51 | * Adds data Returns the data property 52 | * 53 | * This adds data to a multilevel array 54 | * The first level key is the filename calling this function 55 | * The second level is an array for each line in $data 56 | * This allows developers to keep track of what file added what 57 | * 58 | * @param string $data The data to add 59 | * @param array $replace Optional array of things to replace in the data 60 | */ 61 | public function add($data) 62 | { 63 | $caller = debug_backtrace()[0]['file']; 64 | if (!isset($this->data[$caller])) { 65 | $this->data[$caller] = array(); 66 | } 67 | foreach (explode("\n", $data) as $line) { 68 | if( $line != '') array_push($this->data[$caller], $line); 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/SvgComments/SvgComments.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright 2016 Joost De Cock 10 | * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, Version 3 11 | */ 12 | class SvgComments extends SvgBlock 13 | { 14 | /** 15 | * Returns the comments as comment block 16 | * 17 | * Note that we are returning this as a string, 18 | * thereby it usesthe magic __toString() method 19 | * that is defined in the parent class 20 | * 21 | * @see \Freesewing\SvgBlock::__toString() 22 | * 23 | * @return string svg comment block 24 | */ 25 | public function load() 26 | { 27 | if ($this->getData() === false) { 28 | return false; 29 | } else { 30 | return "\n\n"; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/SvgCss/SvgCss.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright 2016 Joost De Cock 10 | * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, Version 3 11 | */ 12 | class SvgCss extends SvgBlock 13 | { 14 | /** 15 | * Returns the css as a style block 16 | * 17 | * Note that we are returning this as a string, 18 | * using the magic __toString() method 19 | * which is defined in the parent class 20 | * 21 | * @see \Freesewing\SvgBlock::__toString() 22 | * 23 | * @return string svg style block 24 | */ 25 | public function load() 26 | { 27 | if ($this->getData() === false) { 28 | return false; 29 | } else { 30 | // Need to make sure @include lines go at the top 31 | return "\n\n"; 32 | } 33 | } 34 | 35 | /** 36 | * Makes sure css @include lines go first 37 | * 38 | * CSS requires @include lines to go first 39 | * So we sort them to have these at the top 40 | * 41 | * @return string The sorted css 42 | */ 43 | private function sortCss() 44 | { 45 | $theseFirst = ''; 46 | $css = ''; 47 | $data = $this->getData(); 48 | if (is_array($data)) { 49 | foreach ($data as $origin) { 50 | foreach ($origin as $line) { 51 | if (substr(trim($line), 0, 1) == '@') { 52 | $theseFirst .= "\n $line"; 53 | } else { 54 | $css .= "\n $line"; 55 | } 56 | } 57 | } 58 | } 59 | 60 | return $theseFirst.$css; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/SvgDefs/SvgDefs.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright 2016 Joost De Cock 10 | * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, Version 3 11 | */ 12 | class SvgDefs extends SvgBlock 13 | { 14 | /** 15 | * Returns the object data as a sv defs block 16 | * 17 | * Note that we are returning this as a string, 18 | * using the magic __toString() method 19 | * which is defined in the parent class 20 | * 21 | * @see \Freesewing\SvgBlock::__toString() 22 | * 23 | * @return string svg defs block 24 | */ 25 | public function load() 26 | { 27 | if ($this->getData() === false) { 28 | return false; 29 | } else { 30 | return "\n\n $this\n\n"; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/SvgInclude/SvgInclude.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright 2016 Joost De Cock 10 | * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, Version 3 11 | */ 12 | class SvgInclude 13 | { 14 | /** @var string $content SVG content to include */ 15 | private $content; 16 | 17 | /** 18 | * Sets the content property 19 | * 20 | * @param string $content 21 | */ 22 | public function set($content) 23 | { 24 | $this->content = $content; 25 | } 26 | 27 | /** 28 | * Returns the content property 29 | * 30 | * @return string 31 | */ 32 | public function get() 33 | { 34 | return $this->content; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/SvgScript/SvgScript.php: -------------------------------------------------------------------------------- 1 | 10 | * @copyright 2016 Joost De Cock 11 | * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, Version 3 12 | */ 13 | class SvgScript extends SvgBlock 14 | { 15 | /** 16 | * Returns the ECAM script as a script block 17 | * 18 | * Note that we are returning this as a string, 19 | * using the magic __toString() method 20 | * which is defined in the parent class 21 | * 22 | * @see \Freesewing\SvgBlock::__toString() 23 | * 24 | * @return string svg style block 25 | */ 26 | public function load() 27 | { 28 | if ($this->getData() === false) { 29 | return false; 30 | } else { 31 | return "\n\n"; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Text/Text.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright 2016 Joost De Cock 10 | * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, Version 3 11 | */ 12 | class Text 13 | { 14 | /** @var \Freesewing\Point $anchor Point to anchor the text on */ 15 | public $anchor; 16 | 17 | /** @var string $text The text itself */ 18 | public $text; 19 | 20 | /** @var array $attributes Attributes for the text */ 21 | public $attributes = array(); 22 | 23 | /** 24 | * Sets the anchor property 25 | * 26 | * @param \Freesewing\Point $anchor The text anchor point 27 | */ 28 | public function setAnchor(\Freesewing\Point $anchor) 29 | { 30 | $this->anchor = $anchor; 31 | } 32 | 33 | /** 34 | * Sets the text property 35 | * 36 | * @param string The actual text to be displayed 37 | */ 38 | public function setText($text) 39 | { 40 | $this->text = $text; 41 | } 42 | 43 | /** 44 | * Sets the attributes property 45 | * 46 | * @param array The text attributes 47 | */ 48 | public function setAttributes($attributes) 49 | { 50 | $this->attributes = $attributes; 51 | } 52 | 53 | /** 54 | * Returns the anchor property 55 | * 56 | * @return \Freesewing\Point the text anchor 57 | */ 58 | public function getAnchor() 59 | { 60 | return $this->anchor; 61 | } 62 | 63 | /** 64 | * Returns the text property 65 | * 66 | * string the text itself 67 | */ 68 | public function getText() 69 | { 70 | return $this->text; 71 | } 72 | 73 | /** 74 | * Returns the attributes property 75 | * 76 | * @return array the text attributes 77 | */ 78 | public function getAttributes() 79 | { 80 | return $this->attributes; 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /src/TextOnPath/TextOnPath.php: -------------------------------------------------------------------------------- 1 | 12 | * @copyright 2016 Joost De Cock 13 | * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, Version 3 14 | */ 15 | class TextOnPath 16 | { 17 | /** @var \Freesewing\Path $path Path to place the text on */ 18 | public $path; 19 | 20 | /** @var string $text The text itself */ 21 | public $text; 22 | 23 | /** @var array $attributes Attributes for the text */ 24 | public $attributes = array(); 25 | 26 | /** 27 | * Sets the path property 28 | * 29 | * @param \Freesewing\Path $path The text anchor path 30 | */ 31 | public function setPath(\Freesewing\Path $path) 32 | { 33 | $this->path = $path; 34 | } 35 | 36 | /** 37 | * Sets the text property 38 | * 39 | * @param string The actual text to be displayed 40 | */ 41 | public function setText($text) 42 | { 43 | $this->text = $text; 44 | } 45 | 46 | /** 47 | * Sets the attributes property 48 | * 49 | * @param array The text attributes 50 | */ 51 | public function setAttributes($attributes) 52 | { 53 | $this->attributes = $attributes; 54 | } 55 | 56 | /** 57 | * Returns the path property 58 | * 59 | * @return \Freesewing\Path the path for the text 60 | */ 61 | public function getPath() 62 | { 63 | return $this->path; 64 | } 65 | 66 | /** 67 | * Returns the text property 68 | * 69 | * @return string the text itself 70 | */ 71 | public function getText() 72 | { 73 | return $this->text; 74 | } 75 | 76 | /** 77 | * Returns the attributes property 78 | * 79 | * @return array the text attributes 80 | */ 81 | public function getAttributes() 82 | { 83 | return $this->attributes; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /src/Yamlr/Yamlr.php: -------------------------------------------------------------------------------- 1 | 12 | * @copyright 2016 Joost De Cock 13 | * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, Version 3 14 | */ 15 | class Yamlr 16 | { 17 | /** 18 | * Loads a Yaml file and returns it as an array 19 | * 20 | * @param string $file The name of the file to load 21 | * 22 | * @return array The Yaml file as array 23 | * 24 | * @throws ParseException Symphony will throw and exception if the Yaml file is not valid 25 | */ 26 | public static function loadYamlFile($file) 27 | { 28 | $yaml = Yaml::parse(file_get_contents($file)); 29 | 30 | return $yaml; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /tests/src/BoundaryTest.php: -------------------------------------------------------------------------------- 1 | assertClassHasAttribute($attribute, '\Freesewing\Boundary'); 15 | } 16 | 17 | public function providerTestAttributeExists() 18 | { 19 | return [ 20 | ['topLeft'], 21 | ['bottomRight'], 22 | ['width'], 23 | ['height'], 24 | ]; 25 | } 26 | 27 | /** 28 | * @param string $methodSuffix The part of the method to call without 'get' or 'set' 29 | * @param $expectedResult Result to check for 30 | * 31 | * @dataProvider providerGettersReturnWhatSettersSet 32 | */ 33 | public function testGettersReturnWhatSettersSet($methodSuffix, $expectedResult) 34 | { 35 | $object = new \Freesewing\Boundary(); 36 | $setMethod = 'set'.$methodSuffix; 37 | $getMethod = 'get'.$methodSuffix; 38 | $object->{$setMethod}($expectedResult); 39 | $this->assertEquals($expectedResult, $object->{$getMethod}()); 40 | } 41 | 42 | public function providerGettersReturnWhatSettersSet() 43 | { 44 | $point = new \Freesewing\Point(); 45 | $point->setX(52); 46 | $point->setY(69); 47 | return [ 48 | ['TopLeft', $point], 49 | ['BottomRight', $point], 50 | ]; 51 | } 52 | 53 | public function testUpdateDimensions() { 54 | $topLeft = new \Freesewing\Point(); 55 | $topLeft->setX(52); 56 | $topLeft->setY(69); 57 | 58 | $bottomRight = new \Freesewing\Point(); 59 | $bottomRight->setX(69); 60 | $bottomRight->setY(5252); 61 | 62 | $object = new \Freesewing\Boundary(); 63 | $object->setTopLeft($topLeft); 64 | $object->setBottomRight($bottomRight); 65 | 66 | $this->assertEquals(17, $object->width); 67 | $this->assertEquals(5183, $object->height); 68 | 69 | $object = new \Freesewing\Boundary(); 70 | $topLeft->setX(52); 71 | $topLeft->setY(69); 72 | $bottomRight->setX(2069); 73 | $bottomRight->setY(252); 74 | $object->setTopLeft($topLeft); 75 | $object->setBottomRight($bottomRight); 76 | 77 | $this->assertEquals(2017, $object->width); 78 | $this->assertEquals(183, $object->height); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /tests/src/CompareServiceTest.php: -------------------------------------------------------------------------------- 1 | assertEquals($service->getServiceName(),'compare'); 28 | } 29 | 30 | /** 31 | * Tests the run method for basic draft 32 | */ 33 | public function estRunBasic() 34 | { 35 | $context = new \Freesewing\Context(); 36 | $context->setRequest(new \Freesewing\Request([ 37 | 'service' => 'compare', 38 | 'pattern' => 'TestPattern', 39 | 'samplerGroup' => 'realMen' 40 | ])); 41 | $context->configure(); 42 | 43 | $service = new CompareService(); 44 | $service->run($context); 45 | 46 | $this->assertContains('Content-Type: image/svg+xml', Output::$headers); 47 | $this->assertEquals(substr(Output::$body,0,54), ''); 48 | } 49 | 50 | /** 51 | * Tests the run method for invalid request 52 | */ 53 | public function testInvalidRequest() 54 | { 55 | $context = new \Freesewing\Context(); 56 | $context->setRequest(new \Freesewing\Request([ 57 | 'service' => 'compare' 58 | ])); 59 | $context->configure(); 60 | 61 | $service = new CompareService(); 62 | $service->run($context); 63 | $this->assertContains('Location: https://freesewing.org/', Output::$headers); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /tests/src/CoordsTest.php: -------------------------------------------------------------------------------- 1 | assertClassHasAttribute($attribute, '\Freesewing\Coords'); 16 | } 17 | 18 | public function providerTestAttributeExists() 19 | { 20 | return [ 21 | ['x'], 22 | ['y'], 23 | ]; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /tests/src/DimensionTest.php: -------------------------------------------------------------------------------- 1 | assertClassHasAttribute($attribute, '\Freesewing\Dimension'); 16 | } 17 | 18 | public function providerTestAttributeExists() 19 | { 20 | return [ 21 | ['label'], 22 | ['leaders'], 23 | ]; 24 | } 25 | 26 | /** 27 | * @param string $methodSuffix The part of the method to call without 'get' or 'set' 28 | * @param $expectedResult Result to check for 29 | * 30 | * @dataProvider providerGettersReturnWhatSettersSet 31 | */ 32 | public function testGettersReturnWhatSettersSet($methodSuffix, $expectedResult) 33 | { 34 | $point = new \Freesewing\Dimension(); 35 | $setMethod = 'set'.$methodSuffix; 36 | $getMethod = 'get'.$methodSuffix; 37 | $point->{$setMethod}($expectedResult); 38 | $this->assertEquals($expectedResult, $point->{$getMethod}()); 39 | } 40 | 41 | public function providerGettersReturnWhatSettersSet() 42 | { 43 | $label = new \Freesewing\TextOnPath(); 44 | $path = new \Freesewing\Path(); 45 | $path->setPathstring('M 1 L 2 L 3 z'); 46 | $label->setPath($path); 47 | $label->setText('foo bar'); 48 | return [ 49 | ['Label', $label], 50 | ['Leaders', [1,2,'foo']], 51 | ]; 52 | } 53 | 54 | /* 55 | * Tests the getPath method 56 | */ 57 | public function testGetPath() 58 | { 59 | $label = new \Freesewing\TextOnPath(); 60 | $path = new \Freesewing\Path(); 61 | $path->setPathstring('M 1 L 2 L 3 z'); 62 | $label->setPath($path); 63 | $label->setText('foo bar'); 64 | $dimension = new \Freesewing\Dimension(); 65 | $dimension->setLabel($label); 66 | $this->assertEquals($dimension->getPath(), $path); 67 | } 68 | 69 | /* 70 | * Tests the addLeader method 71 | */ 72 | public function testAddLeader() 73 | { 74 | $path = new \Freesewing\Path(); 75 | $path->setPathstring('M 1 L 2 L 3 z'); 76 | $dimension = new \Freesewing\Dimension(); 77 | $dimension->addLeader($path); 78 | $this->assertEquals($dimension->getLeaders(), [$path]); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /tests/src/DraftServiceTest.php: -------------------------------------------------------------------------------- 1 | assertEquals($service->getServiceName(),'draft'); 28 | } 29 | 30 | /** 31 | * Tests the run method for basic draft 32 | */ 33 | public function estRunBasic() 34 | { 35 | $context = new \Freesewing\Context(); 36 | $context->setRequest(new \Freesewing\Request(['service' => 'draft', 'pattern' => 'TestPattern'])); 37 | $context->configure(); 38 | 39 | $service = new DraftService(); 40 | $service->run($context); 41 | 42 | $this->assertContains('Content-Type: image/svg+xml', Output::$headers); 43 | $this->assertEquals(substr(Output::$body,0,54), ''); 44 | } 45 | 46 | /** 47 | * Tests the run method for basic draft with viewbox 48 | */ 49 | public function estRunBasicWithViewbox() 50 | { 51 | $context = new \Freesewing\Context(); 52 | $context->setRequest(new \Freesewing\Request(['service' => 'draft', 'pattern' => 'TestPattern', 'viewbox' => '10,10,200,200', 'theme' => 'Paperless'])); 53 | $context->configure(); 54 | 55 | $service = new DraftService(); 56 | $service->run($context); 57 | 58 | $this->assertContains('Content-Type: image/svg+xml', Output::$headers); 59 | $this->assertEquals(substr(Output::$body,0,54), ''); 60 | } 61 | 62 | /** 63 | * Tests the run method for invalid request 64 | */ 65 | public function testRunPatternInfo() 66 | { 67 | $context = new \Freesewing\Context(); 68 | $context->setRequest(new \Freesewing\Request(['service' => 'draft'])); 69 | $context->configure(); 70 | 71 | $service = new DraftService(); 72 | $service->run($context); 73 | 74 | $this->assertContains('Location: https://freesewing.org/', Output::$headers); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /tests/src/InfoServiceTest.php: -------------------------------------------------------------------------------- 1 | assertEquals($service->getServiceName(),'info'); 28 | } 29 | 30 | /** 31 | * Tests the run method for base info service 32 | */ 33 | public function testRunBasicInfo() 34 | { 35 | $context = new \Freesewing\Context(); 36 | $context->setRequest(new \Freesewing\Request(['service' => 'info'])); 37 | $context->configure(); 38 | 39 | $service = new InfoService(); 40 | $service->run($context); 41 | $json = json_decode(Output::$body,1); 42 | 43 | $this->assertEquals(is_array($json), true); 44 | $this->assertEquals(is_array($json['services']), true); 45 | $this->assertEquals(is_array($json['patterns']), true); 46 | $this->assertEquals(is_array($json['themes']), true); 47 | $this->assertEquals(is_array($json['channels']), true); 48 | } 49 | 50 | /** 51 | * Tests the run method for pattern info 52 | */ 53 | public function testRunPatternInfo() 54 | { 55 | $context = new \Freesewing\Context(); 56 | $context->setRequest(new \Freesewing\Request(['service' => 'info', 'pattern' => 'TestPattern'])); 57 | $context->configure(); 58 | 59 | $service = new InfoService(); 60 | $service->run($context); 61 | $json = json_decode(Output::$body,1); 62 | 63 | $this->assertEquals(is_array($json), true); 64 | $this->assertEquals(is_array($json['info']), true); 65 | $this->assertEquals(isset($json['info']['version']), true); 66 | $this->assertEquals(is_array($json['parts']), true); 67 | $this->assertEquals(isset($json['pattern']), true); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /tests/src/LayoutBlockTest.php: -------------------------------------------------------------------------------- 1 | assertClassHasAttribute($attribute, '\Freesewing\LayoutBlock'); 16 | } 17 | 18 | public function providerTestAttributeExists() 19 | { 20 | return [ 21 | ['x'], 22 | ['y'], 23 | ['w'], 24 | ['h'], 25 | ['used'], 26 | ]; 27 | } 28 | 29 | /** 30 | * Tests the setPosition method 31 | */ 32 | public function testSetPosition() 33 | { 34 | $block = new \Freesewing\LayoutBlock(); 35 | $block->setPosition(10,20); 36 | $this->assertEquals($block->x, 10); 37 | $this->assertEquals($block->y, 20); 38 | } 39 | 40 | /** 41 | * Tests the setSize method 42 | */ 43 | public function testSetSize() 44 | { 45 | $block = new \Freesewing\LayoutBlock(); 46 | $block->setSize(10,20); 47 | $this->assertEquals($block->w, 10); 48 | $this->assertEquals($block->h, 20); 49 | } 50 | 51 | /** 52 | * Tests the setUsed and isUsed method 53 | */ 54 | public function testSetUsedIsUsed() 55 | { 56 | $block = new \Freesewing\LayoutBlock(); 57 | $block->setUsed(true); 58 | $this->assertEquals($block->isUsed(), true); 59 | $block->setUsed(false); 60 | $this->assertEquals($block->isUsed(), false); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /tests/src/MeasurementsSamplerTest.php: -------------------------------------------------------------------------------- 1 | [ 16 | 'group' => 'maleStandardUsSizes', 17 | ], 18 | 'groups' => [ 19 | 'realMen' => ['joost'], 20 | 'maleStandardUsSizes' => [ 21 | 'usSize34', 22 | 'usSize36', 23 | 'usSize38', 24 | 'usSize40', 25 | 'usSize42', 26 | 'usSize44', 27 | ], 28 | ], 29 | 'measurements' => [ 30 | 'acrossBack' => [ 31 | 'joost' => 450, 32 | 'usSize34' => 380, 33 | 'usSize36' => 390, 34 | 'usSize38' => 400, 35 | 'usSize40' => 410, 36 | 'usSize42' => 420, 37 | 'usSize44' => 430, 38 | ] 39 | ] 40 | ]; 41 | 42 | $sampler = new \Freesewing\MeasurementsSampler(); 43 | $sampler->setModelConfig($config); 44 | $models = $sampler->loadPatternModels('maleStandardUsSizes'); 45 | 46 | foreach($models as $key => $model) { 47 | foreach($config['measurements'] as $m => $ignoreMe) { 48 | $this->assertEquals($model->getMeasurement($m), $config['measurements'][$m][$key]); 49 | } 50 | } 51 | 52 | $models = $sampler->loadPatternModels('nonexisting'); 53 | 54 | foreach($models as $key => $model) { 55 | foreach($config['measurements'] as $m => $ignoreMe) { 56 | $this->assertEquals($model->getMeasurement($m), $config['measurements'][$m][$key]); 57 | } 58 | } 59 | 60 | $config['default']['group'] = [0 => 'maleStandardUsSizes', 1 => 'otherGroup']; 61 | $sampler->setModelConfig($config); 62 | $models = $sampler->loadPatternModels('nonexisting'); 63 | foreach($models as $key => $model) { 64 | $this->assertEquals($model->getMeasurement('acrossBack'), $config['measurements']['acrossBack'][$key]); 65 | } 66 | 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /tests/src/ModelTest.php: -------------------------------------------------------------------------------- 1 | assertClassHasAttribute('measurements','\Freesewing\Model'); 10 | } 11 | 12 | public function testSetMeasurement() 13 | { 14 | $model = new \Freesewing\Model(); 15 | $model->setMeasurement('Shoe size', 52); 16 | $this->assertEquals(52, $model->getMeasurement('Shoe size')); 17 | } 18 | 19 | public function testAddMeasurements() 20 | { 21 | $measurements = [ 22 | 'Shoe size' => 52, 23 | 'Toe length' => 6.3, 24 | 'Height' => 198, 25 | ]; 26 | $model = new \Freesewing\Model(); 27 | $model->addMeasurements($measurements); 28 | 29 | $this->assertEquals(52, $model->getMeasurement('Shoe size')); 30 | $this->assertEquals(6.3, $model->getMeasurement('Toe length')); 31 | $this->assertEquals(198, $model->getMeasurement('Height')); 32 | $this->assertEquals(6.3, $model->m('Toe length')); 33 | $this->assertEquals(198, $model->m('Height')); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /tests/src/NoteTest.php: -------------------------------------------------------------------------------- 1 | assertClassHasAttribute($attribute, '\Freesewing\Note'); 16 | } 17 | 18 | public function providerTestAttributeExists() 19 | { 20 | return [ 21 | ['path'], 22 | ]; 23 | } 24 | 25 | /** 26 | * @param string $methodSuffix The part of the method to call without 'get' or 'set' 27 | * @param $expectedResult Result to check for 28 | * 29 | * @dataProvider providerGettersReturnWhatSettersSet 30 | */ 31 | public function testGettersReturnWhatSettersSet($methodSuffix, $expectedResult) 32 | { 33 | $note = new \Freesewing\Note(); 34 | $setMethod = 'set'.$methodSuffix; 35 | $getMethod = 'get'.$methodSuffix; 36 | $note->{$setMethod}($expectedResult); 37 | $this->assertEquals($expectedResult, $note->{$getMethod}()); 38 | } 39 | 40 | public function providerGettersReturnWhatSettersSet() 41 | { 42 | $path = new \Freesewing\Path(); 43 | $path->setPathstring('M 1 L 2 L 3 z'); 44 | return [ 45 | ['Path', $path], 46 | ]; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /tests/src/OptionsSamplerTest.php: -------------------------------------------------------------------------------- 1 | 200, 15 | ]; 16 | 17 | $sampler = new \Freesewing\OptionsSampler(); 18 | $sampler->setPattern(new \Freesewing\Patterns\Tests\TestPattern()); 19 | 20 | $this->assertEquals($sampler->loadModelMeasurements(), $measurements); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/src/PointTest.php: -------------------------------------------------------------------------------- 1 | assertClassHasAttribute($attribute, '\Freesewing\Point'); 16 | } 17 | 18 | public function providerTestAttributeExists() 19 | { 20 | return [ 21 | ['x'], 22 | ['y'], 23 | ['description'], 24 | ]; 25 | } 26 | 27 | /** 28 | * @param string $methodSuffix The part of the method to call without 'get' or 'set' 29 | * @param $expectedResult Result to check for 30 | * 31 | * @dataProvider providerGettersReturnWhatSettersSet 32 | */ 33 | public function testGettersReturnWhatSettersSet($methodSuffix, $expectedResult) 34 | { 35 | $point = new \Freesewing\Point(); 36 | $setMethod = 'set'.$methodSuffix; 37 | $getMethod = 'get'.$methodSuffix; 38 | $point->{$setMethod}($expectedResult); 39 | $this->assertEquals($expectedResult, $point->{$getMethod}()); 40 | } 41 | 42 | public function providerGettersReturnWhatSettersSet() 43 | { 44 | return [ 45 | ['X', 52], 46 | ['Y', 69], 47 | ['Description', 'The description'], 48 | ]; 49 | } 50 | 51 | /** 52 | * @param string $methodSuffix The part of the method to call without 'set' 53 | * 54 | * @dataProvider providerSetXAndSetYSetNonNumericValuesToZero 55 | */ 56 | public function testSetXAndSetYSetNonNumericValuesToZero($methodSuffix) 57 | { 58 | $point = new \Freesewing\Point(); 59 | $setMethod = 'set'.$methodSuffix; 60 | $getMethod = 'get'.$methodSuffix; 61 | $point->{$setMethod}('sorcha'); 62 | $this->assertEquals(0, $point->{$getMethod}()); 63 | } 64 | 65 | public function providerSetXAndSetYSetNonNumericValuesToZero() 66 | { 67 | return [ 68 | ['X'], 69 | ['Y'], 70 | ]; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /tests/src/PolynomialTest.php: -------------------------------------------------------------------------------- 1 | assertClassHasAttribute($attribute, '\Freesewing\Polynomial'); 16 | } 17 | 18 | public function providerTestAttributeExists() 19 | { 20 | return [ 21 | ['precision'], 22 | ['tolerance'], 23 | ['coefs'], 24 | ]; 25 | } 26 | 27 | /** 28 | * Tests the getRoots method 29 | */ 30 | public function testGetRoots() 31 | { 32 | $p = new \Freesewing\Polynomial([]); 33 | $this->assertEquals($p->getRoots(), []); 34 | 35 | $p = new \Freesewing\Polynomial([1]); 36 | $this->assertEquals($p->getRoots(), []); 37 | 38 | $p = new \Freesewing\Polynomial([1,2]); 39 | $this->assertEquals($p->getRoots(), [-2]); 40 | 41 | $p = new \Freesewing\Polynomial([1,2,-3]); 42 | $this->assertEquals($p->getRoots(), [1,-3]); 43 | 44 | $p = new \Freesewing\Polynomial([1,2,-3,4]); 45 | $this->assertEquals($p->getRoots(), [-3.284277537307]); 46 | } 47 | 48 | /** 49 | * Tests exception thrown in evalu method 50 | * 51 | * @expectedException InvalidArgumentException 52 | * @expectedExceptionMessage Polinomial::Eval() : Parameter must be numeric 53 | */ 54 | public function testEvaluException() 55 | { 56 | $poly = new \Freesewing\Polynomial([1,2,3]); 57 | $poly->evalu('boom'); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /tests/src/RequestTest.php: -------------------------------------------------------------------------------- 1 | assertClassHasAttribute($attribute, '\Freesewing\Request'); 16 | } 17 | 18 | public function providerTestAttributeExists() 19 | { 20 | return [ 21 | ['data'], 22 | ['info'], 23 | ]; 24 | } 25 | 26 | /** 27 | * Tests the constructor 28 | */ 29 | public function testConstructor() 30 | { 31 | $request = new \Freesewing\Request(); 32 | $info = $request->getInfo(); 33 | 34 | $this->assertEquals(isset($info['time']), true); 35 | unset($info['time']); 36 | } 37 | 38 | /** 39 | * Tests the getData method 40 | */ 41 | public function testGetData() 42 | { 43 | $data = ['foo' => 'bar', 'moo' => 'gnar']; 44 | 45 | $request = new \Freesewing\Request($data); 46 | 47 | $this->assertEquals($request->getData('foo'), 'bar'); 48 | $this->assertEquals($request->getData('moo'), 'gnar'); 49 | $this->assertEquals($request->getData('zoo'), null); 50 | } 51 | 52 | /** 53 | * Tests the getAllData method 54 | */ 55 | public function testGetAllData() 56 | { 57 | $data = ['foo' => 'bar', 'moo' => 'gnar']; 58 | 59 | $request = new \Freesewing\Request($data); 60 | 61 | $this->assertEquals($request->getAllData(), $data); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /tests/src/SamplerTest.php: -------------------------------------------------------------------------------- 1 | assertClassHasAttribute($attribute, '\Freesewing\Sampler'); 18 | } 19 | 20 | public function providerTestAttributeExists() 21 | { 22 | return [ 23 | ['partContainer'], 24 | ['boundaries'], 25 | ['modelConfig'], 26 | ['models'], 27 | ['pattern'], 28 | ]; 29 | } 30 | 31 | public function providerGettersReturnWhatSettersSet() 32 | { 33 | $pattern = new \Freesewing\Patterns\Tests\TestPattern(); 34 | return [ 35 | ['Pattern', new \Freesewing\Patterns\Tests\TestPattern()], 36 | ]; 37 | } 38 | 39 | /** 40 | * Tests the loadPatternOptions method 41 | */ 42 | public function testLoadPatternOptions() 43 | { 44 | $in = [ 45 | 'options' => [ 46 | 'option1' => [ 47 | 'type' => 'measure', 48 | 'default' => 52, 49 | ], 50 | 'option2' => [ 51 | 'type' => 'percent', 52 | 'default' => 80, 53 | ], 54 | ], 55 | ]; 56 | 57 | $out = ['option1' => 52, 'option2' => 0.8]; 58 | // Mock the pattern 59 | $pattern = $this->getMockBuilder('\freesewing\patterns\Tests\TestPattern')->getMock(); 60 | $pattern->method('getConfig')->willReturn($in); 61 | 62 | $object = new \Freesewing\Sampler(); 63 | $object->setPattern($pattern); 64 | 65 | $this->assertEquals($object->loadPatternOptions(), $out); 66 | } 67 | 68 | private function loadFixture($fixture) 69 | { 70 | $dir = 'tests/src/fixtures'; 71 | $file = "$dir/Sampler.$fixture.data"; 72 | return file_get_contents($file); 73 | } 74 | 75 | private function saveFixture($fixture, $data) 76 | { 77 | $dir = 'tests/src/fixtures'; 78 | $file = "$dir/Sampler.$fixture.data"; 79 | $f = fopen($file,'w'); 80 | fwrite($f,$data); 81 | fclose($f); 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /tests/src/StackTest.php: -------------------------------------------------------------------------------- 1 | s = new Stack(); 12 | } 13 | 14 | /** 15 | * @param string $attribute Attribute to check for 16 | * 17 | * @dataProvider providerTestAttributeExists 18 | */ 19 | public function testAttributeExists($attribute) 20 | { 21 | $this->assertClassHasAttribute($attribute, '\Freesewing\Stack'); 22 | } 23 | 24 | public function providerTestAttributeExists() 25 | { 26 | return [ 27 | ['items'], 28 | ['intersections'], 29 | ]; 30 | } 31 | 32 | /** 33 | * Tests the push method 34 | */ 35 | public function testPush() 36 | { 37 | $this->s->push(['test']); 38 | $this->assertEquals($this->s->items[0], 'test'); 39 | $this->s->push([2,3,4,5,6]); 40 | $this->assertEquals(count($this->s->items), 6); 41 | } 42 | 43 | /** 44 | * Tests the addIntersection method 45 | */ 46 | public function testAddIntersection() 47 | { 48 | $this->s->addIntersection('test'); 49 | $this->assertEquals($this->s->intersections[0], 'test'); 50 | $this->s->addIntersection(2); 51 | $this->s->addIntersection(3); 52 | $this->s->addIntersection(4); 53 | $this->assertEquals(count($this->s->intersections), 4); 54 | } 55 | 56 | /** 57 | * Tests the replace method 58 | */ 59 | public function testReplace() 60 | { 61 | $this->s->push(['Quick','yellow','jumps']); 62 | $this->s->replace('yellow', ['brown', 'fox']); 63 | $this->assertEquals($this->s->items, ['Quick','brown', 'fox','jumps']); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /tests/src/SvgAttributesTest.php: -------------------------------------------------------------------------------- 1 | \n"; 11 | 12 | $object = new \Freesewing\SvgAttributes(); 13 | $object->add($data); 14 | 15 | $this->assertEquals($expectedResult, $object->load()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tests/src/SvgCommentsTest.php: -------------------------------------------------------------------------------- 1 | \n"; 14 | 15 | $object = new \Freesewing\SvgComments(); 16 | $object->add($data); 17 | $this->assertEquals($object->load(), $expectedResult); 18 | } 19 | 20 | /* 21 | * Tests return when there's no data 22 | */ 23 | public function testFalseOnNoData() 24 | { 25 | $object = new \Freesewing\SvgComments(); 26 | $this->assertEquals(false, $object->load()); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /tests/src/SvgCssTest.php: -------------------------------------------------------------------------------- 1 | \n \n\n"; 11 | 12 | $object = new \Freesewing\SvgCss(); 13 | $object->add($data); 14 | $this->assertEquals($expectedResult, $object->load()); 15 | } 16 | 17 | /* 18 | * Tests return when there's no data 19 | */ 20 | public function testFalseOnNoData() 21 | { 22 | $object = new \Freesewing\SvgCss(); 23 | $this->assertEquals(false, $object->load()); 24 | } 25 | 26 | /* 27 | * Tests CSS soring 28 | */ 29 | public function testCssSorting() 30 | { 31 | $data = "sorcha\n@line"; 32 | $expectedResult = "\n\n"; 33 | 34 | $object = new \Freesewing\SvgCss(); 35 | $object->add($data); 36 | 37 | $this->assertEquals($expectedResult, $object->load()); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tests/src/SvgDefsTest.php: -------------------------------------------------------------------------------- 1 | \n sorcha \n\n"; 11 | 12 | $object = new \Freesewing\SvgDefs(); 13 | $object->add($data); 14 | $this->assertEquals($expectedResult, $object->load()); 15 | } 16 | 17 | /* 18 | * Tests return when there's no data 19 | */ 20 | public function testFalseOnNoData() 21 | { 22 | $object = new \Freesewing\SvgDefs(); 23 | $this->assertEquals(false, $object->load()); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tests/src/SvgDocumentTest.php: -------------------------------------------------------------------------------- 1 | svgBasic = "\n\n\n\n\n\n"; 11 | $this->svgWithBody = "\n\nsorcha\n\n\n\n"; 12 | $headerComments = new \Freesewing\SvgComments(); 13 | $svgAttributes = new \Freesewing\SvgAttributes(); 14 | $css = new \Freesewing\SvgCss(); 15 | $script = new \Freesewing\SvgScript(); 16 | $defs = new \Freesewing\SvgDefs(); 17 | $footerComments = new \Freesewing\SvgComments(); 18 | 19 | $this->object = new \Freesewing\SvgDocument( 20 | $headerComments, 21 | $svgAttributes, 22 | $css, 23 | $script, 24 | $defs, 25 | $footerComments 26 | ); 27 | } 28 | 29 | 30 | /** 31 | * @param string $attribute Attribute to check for 32 | * 33 | * @dataProvider providerTestAttributeExists 34 | */ 35 | public function testAttributeExists($attribute) 36 | { 37 | $this->assertClassHasAttribute($attribute, '\Freesewing\SvgDocument'); 38 | } 39 | 40 | public function providerTestAttributeExists() 41 | { 42 | return [ 43 | ['svgBody'], 44 | ['headerComments'], 45 | ['svgAttributes'], 46 | ['css'], 47 | ['script'], 48 | ['defs'], 49 | ['footerComments'], 50 | ]; 51 | } 52 | 53 | public function testToStringAndConstructor() 54 | { 55 | $this->assertEquals($this->svgBasic, ''.$this->object); // Using to-string conversion 56 | } 57 | 58 | public function testSetSvgBody() 59 | { 60 | $this->object->setSvgBody('sorcha'); 61 | $this->assertEquals($this->svgWithBody, ''.$this->object); // Using to-string conversion 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /tests/src/SvgIncludeTest.php: -------------------------------------------------------------------------------- 1 | set($data); 16 | $this->assertEquals($object->get(), $data); 17 | } 18 | 19 | public function providerGetGetsWhatSetSets() 20 | { 21 | return [ 22 | ['X'], 23 | [69], 24 | ['A description'], 25 | [''], 26 | ]; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /tests/src/SvgScriptTest.php: -------------------------------------------------------------------------------- 1 | \n \n\n"; 11 | 12 | $object = new \Freesewing\SvgScript(); 13 | $object->add($data); 14 | $this->assertEquals($expectedResult, $object->load()); 15 | } 16 | 17 | /* 18 | * Tests return when there's no data 19 | */ 20 | public function testFalseOnNoData() 21 | { 22 | $object = new \Freesewing\SvgScript(); 23 | $this->assertEquals(false, $object->load()); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tests/src/SvgSnippetTest.php: -------------------------------------------------------------------------------- 1 | assertClassHasAttribute($attribute, '\Freesewing\SvgSnippet'); 16 | } 17 | 18 | public function providerTestAttributeExists() 19 | { 20 | return [ 21 | ['anchor'], 22 | ['reference'], 23 | ['description'], 24 | ['attributes'], 25 | ]; 26 | } 27 | 28 | /** 29 | * @param string $methodSuffix The part of the method to call without 'get' or 'set' 30 | * @param $expectedResult Result to check for 31 | * 32 | * @dataProvider providerGettersReturnWhatSettersSet 33 | */ 34 | public function testGettersReturnWhatSettersSet($methodSuffix, $expectedResult) 35 | { 36 | $object = new \Freesewing\SvgSnippet(); 37 | $setMethod = 'set'.$methodSuffix; 38 | $getMethod = 'get'.$methodSuffix; 39 | $object->{$setMethod}($expectedResult); 40 | $this->assertEquals($expectedResult, $object->{$getMethod}()); 41 | } 42 | 43 | public function providerGettersReturnWhatSettersSet() 44 | { 45 | $anchor = new \Freesewing\Point(); 46 | $anchor->setX(52); 47 | $anchor->setY(69); 48 | return [ 49 | ['Anchor', $anchor], 50 | ['Reference', 69], 51 | ['Description', 'The description'], 52 | ['Attributes', ['class' => 'seam-allowance', 'dx' => 12]], 53 | ]; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /tests/src/YamlrTest.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'banana', 18 | 'kiwi', 19 | ], 20 | 'colors' => [ 21 | 'purple', 22 | 'blue', 23 | 'pink' 24 | ] 25 | ]; 26 | $yamlr = new \Freesewing\Yamlr(); 27 | $config = $yamlr->loadYamlFile($this->loadTemplate('correct')); 28 | 29 | $this->assertEquals($data, $config); 30 | } 31 | 32 | /** 33 | * @expectedException Symfony\Component\Yaml\Exception\ParseException 34 | * @expectedExceptionMessage Unable to parse 35 | */ 36 | public function testFaultyYamlFile() 37 | { 38 | $yamlr = new \Freesewing\Yamlr(); 39 | $config = $yamlr->loadYamlFile($this->loadTemplate('incorrect')); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /tests/src/assets/testFunctions.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10cm 10 | 11 | 12 | 13 | 10cm 14 | 15 | 16 | 17 | 14.14cm 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /tests/src/fixtures/SvgRenderbot.include.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/src/fixtures/SvgRenderbot.note.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | This is an example 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/src/fixtures/SvgRenderbot.path.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/src/fixtures/SvgRenderbot.pathFromPart.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/src/fixtures/SvgRenderbot.pattern.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/src/fixtures/SvgRenderbot.snippet.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/src/fixtures/SvgRenderbot.text.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | This is an example 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/src/fixtures/SvgRenderbot.textOnPath.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | This is an example 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/src/fixtures/SvgRenderbot.transform.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/src/fixtures/Utils.debug.txt: -------------------------------------------------------------------------------- 1 | ┌──────────────────────────────────────────────────────────────────────────────┐ 2 | │ $data │ 3 | └──────────────────────────────────────────────────────────────────────────────┘ 4 | string (4) "test" 5 | ════════════════════════════════════════════════════════════════════════════════ 6 | Called from +251 /m8/api/src/Utils/Utils.php 7 | -------------------------------------------------------------------------------- /tests/src/fixtures/YamlrTest.correct.yml: -------------------------------------------------------------------------------- 1 | fruit: 2 | - banana 3 | - kiwi 4 | colors: 5 | - purple 6 | - blue 7 | - pink 8 | -------------------------------------------------------------------------------- /tests/src/fixtures/YamlrTest.incorrect.yml: -------------------------------------------------------------------------------- 1 | fruit: 2 | - banana 3 | - kiwi 4 | frog 5 | colors: 6 | - purple 7 | - blue 8 | - pink 9 | -------------------------------------------------------------------------------- /tests/themes/DesignerTest.php: -------------------------------------------------------------------------------- 1 | assertFalse($svgDocument->script->load()); 27 | $theme->themeSvg($svgDocument); 28 | $this->assertContains('ecmascript',$svgDocument->script->load()); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /tests/themes/DeveloperTest.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 13 | return true; 14 | 15 | $svgDocument = new \Freesewing\SvgDocument( 16 | new \Freesewing\SvgComments(), 17 | new \Freesewing\SvgAttributes(), 18 | new \Freesewing\SvgCss(), 19 | new \Freesewing\SvgScript(), 20 | new \Freesewing\SvgDefs(), 21 | new \Freesewing\SvgComments() 22 | ); 23 | $theme = new \Freesewing\Themes\Core\Developer(); 24 | $context = new \Freesewing\Context(); 25 | $context->setRequest(new \Freesewing\Request(['service' => 'draft', 'pattern' => 'TestPattern', 'parts' => 'testPart', 'forceParts' => true])); 26 | $response = $theme->themeResponse($context); 27 | $this->assertEquals($response->getFormat(), 'json'); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /tests/themes/PaperlessTest.php: -------------------------------------------------------------------------------- 1 | assertTrue($theme->isPaperless()); 28 | } 29 | 30 | private function loadFixture($fixture) 31 | { 32 | $dir = \Freesewing\Utils::getApiDir().'/tests/themes/fixtures'; 33 | $file = "$dir/Paperless.$fixture.data"; 34 | return file_get_contents($file); 35 | } 36 | 37 | private function saveFixture($fixture, $data) 38 | { 39 | return true; 40 | $dir = \Freesewing\Utils::getApiDir().'/tests/themes/fixtures'; 41 | $file = "$dir/Paperless.$fixture.data"; 42 | $f = fopen($file,'w'); 43 | fwrite($f,$data); 44 | fclose($f); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /tests/themes/fixtures/Info.infoHtml.data: -------------------------------------------------------------------------------- 1 |

Core version

2 |
  • phpunit

Services

3 |
    4 |
  • service 1
  • 5 |
  • service 2
  • 6 |

Patterns

7 |
    8 |
  • Core 9 |
      10 |
    • pattern 1
    • 11 |
    • pattern 2
    • 12 |
    13 |
  • 14 |

Channels

15 |
    16 |
  • Core 17 |
      18 |
    • channel 1
    • 19 |
    • channel 2
    • 20 |
    21 |
  • 22 |

Themes

23 |
    24 |
  • Core 25 |
      26 |
    • theme 1
    • 27 |
    • theme 2
    • 28 |
    29 |
  • 30 |
-------------------------------------------------------------------------------- /tests/themes/fixtures/Info.patternInfoHtml.data: -------------------------------------------------------------------------------- 1 |
2 |

Test Pattern

3 |

Info

4 |
    5 |
  • name » Test Pattern
  • 6 |
  • version » 1.0
  • 7 |
  • date » 20170118
  • 8 |
  • author » Joost De Cock
  • 9 |
  • email » joost@decock.org
  • 10 |
  • company » freesewing.org
  • 11 |
12 |

Parts

13 |
    14 |
  • testPart » Test Part
  • 15 |
16 |

Measurements

17 |
    18 |
  • someMeasurement (default » 200mm)
  • 19 |
20 |

Options

21 |
    22 |
  • measureOption
    • Type » measure
    • Min » 10
    • 23 |
    • Max » 50
    • 24 |
    • Default » 30
  • 25 |
  • angleOption
    • Type » angle
  • 26 |
  • percentOption
    • Type » percent
    • Default » 50
  • 27 |
  • chooseOneOption
    • Type » chooseOne
  • 28 |
29 |

Sampler models

30 |
Defaults
31 |
    32 |
  • group » someGroup
  • 33 |
34 |
Groups
35 |
    36 |
  • someGroup
      37 |
    • someModel
  • 38 |
  • anotherGroup
      39 |
    • anotherModel
  • 40 |
41 |
Model measurements
42 |
    43 |
  • someMeasurement
      44 |
    • someModel » 123
    • 45 |
    • anotherModel » 321
  • 46 |
47 |
-------------------------------------------------------------------------------- /tests/themes/fixtures/Info.patternInfoJson.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joostdecock/core/e313c2cd078745812995ae63bfe1a64d0b8632c3/tests/themes/fixtures/Info.patternInfoJson.data -------------------------------------------------------------------------------- /tests/themes/fixtures/Info.patternInfoOther.data: -------------------------------------------------------------------------------- 1 | a:7:{s:6:"hidden";b:1;s:4:"info";a:6:{s:4:"name";s:12:"Test Pattern";s:7:"version";s:3:"1.0";s:4:"date";i:20170118;s:6:"author";s:13:"Joost De Cock";s:5:"email";s:16:"joost@decock.org";s:7:"company";s:14:"freesewing.org";}s:5:"parts";a:1:{s:8:"testPart";s:9:"Test Part";}s:12:"measurements";a:1:{s:15:"someMeasurement";i:200;}s:7:"options";a:4:{s:13:"measureOption";a:4:{s:4:"type";s:7:"measure";s:3:"min";i:10;s:3:"max";i:50;s:7:"default";i:30;}s:11:"angleOption";a:4:{s:4:"type";s:5:"angle";s:7:"default";i:45;s:3:"min";i:10;s:3:"max";i:50;}s:13:"percentOption";a:4:{s:4:"type";s:7:"percent";s:7:"default";i:50;s:3:"min";i:10;s:3:"max";i:50;}s:15:"chooseOneOption";a:3:{s:4:"type";s:9:"chooseOne";s:7:"options";a:2:{i:1;s:8:"Option 1";i:2;s:8:"Option 2";}s:7:"default";i:1;}}s:6:"models";a:3:{s:7:"default";a:1:{s:5:"group";s:9:"someGroup";}s:6:"groups";a:2:{s:9:"someGroup";a:1:{i:0;s:9:"someModel";}s:12:"anotherGroup";a:1:{i:0;s:12:"anotherModel";}}s:12:"measurements";a:1:{s:15:"someMeasurement";a:2:{s:9:"someModel";i:123;s:12:"anotherModel";i:321;}}}s:7:"pattern";s:11:"TestPattern";} -------------------------------------------------------------------------------- /tests/themes/fixtures/Info.patternInfoPhp.data: -------------------------------------------------------------------------------- 1 | a:7:{s:6:"hidden";b:1;s:4:"info";a:6:{s:4:"name";s:12:"Test Pattern";s:7:"version";s:3:"1.0";s:4:"date";i:20170118;s:6:"author";s:13:"Joost De Cock";s:5:"email";s:16:"joost@decock.org";s:7:"company";s:14:"freesewing.org";}s:5:"parts";a:1:{s:8:"testPart";s:9:"Test Part";}s:12:"measurements";a:1:{s:15:"someMeasurement";i:200;}s:7:"options";a:4:{s:13:"measureOption";a:4:{s:4:"type";s:7:"measure";s:3:"min";i:10;s:3:"max";i:50;s:7:"default";i:30;}s:11:"angleOption";a:4:{s:4:"type";s:5:"angle";s:7:"default";i:45;s:3:"min";i:10;s:3:"max";i:50;}s:13:"percentOption";a:4:{s:4:"type";s:7:"percent";s:7:"default";i:50;s:3:"min";i:10;s:3:"max";i:50;}s:15:"chooseOneOption";a:3:{s:4:"type";s:9:"chooseOne";s:7:"options";a:2:{i:1;s:8:"Option 1";i:2;s:8:"Option 2";}s:7:"default";i:1;}}s:6:"models";a:3:{s:7:"default";a:1:{s:5:"group";s:9:"someGroup";}s:6:"groups";a:2:{s:9:"someGroup";a:1:{i:0;s:9:"someModel";}s:12:"anotherGroup";a:1:{i:0;s:12:"anotherModel";}}s:12:"measurements";a:1:{s:15:"someMeasurement";a:2:{s:9:"someModel";i:123;s:12:"anotherModel";i:321;}}}s:7:"pattern";s:11:"TestPattern";} -------------------------------------------------------------------------------- /themes/Core/Basic/Basic.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2016 Joost De Cock 14 | * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, Version 3 15 | */ 16 | class Basic extends Theme 17 | { 18 | } 19 | -------------------------------------------------------------------------------- /themes/Core/Basic/config.yml: -------------------------------------------------------------------------------- 1 | settings: 2 | partMargin: 5 3 | isPaperless: false 4 | 5 | options: 6 | - parts 7 | - forceParts 8 | - embedFluid 9 | -------------------------------------------------------------------------------- /themes/Core/BasicJson/BasicJson.php: -------------------------------------------------------------------------------- 1 | 11 | * @copyright 2018 Joost De Cock 12 | * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, Version 3 13 | */ 14 | class BasicJson extends Basic 15 | { 16 | /** 17 | * Outputs the pattern + info as JSON 18 | * 19 | * @param \Freesewing\Context $context The context object 20 | * 21 | * @return \Freesewing\Response $response The response object 22 | */ 23 | public function themeResponse(Context $context) 24 | { 25 | $response = new \Freesewing\Response(); 26 | $response->addCacheHeaders($context->getRequest()); 27 | $response->addHeader('Content-Type', 'Content-Type: application/json'); 28 | $response->setFormat('json'); 29 | $response->setBody([ 30 | 'version' => $context->getPattern()->getVersion(), 31 | 'svg' => "{$context->getSvgDocument()}", 32 | ]); 33 | 34 | return $response; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /themes/Core/BasicJson/config.yml: -------------------------------------------------------------------------------- 1 | settings: 2 | partMargin: 5 3 | isPaperless: false 4 | 5 | options: 6 | - parts 7 | - forceParts 8 | - embedFluid 9 | -------------------------------------------------------------------------------- /themes/Core/Compare/Compare.php: -------------------------------------------------------------------------------- 1 | 11 | * @copyright 2016 Joost De Cock 12 | * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, Version 3 13 | */ 14 | class Compare extends Sampler 15 | { 16 | } 17 | -------------------------------------------------------------------------------- /themes/Core/Compare/config.yml: -------------------------------------------------------------------------------- 1 | settings: 2 | partMargin: 5 3 | isPaperless: false 4 | 5 | options: 6 | - parts 7 | - forceParts 8 | - embedFluid 9 | -------------------------------------------------------------------------------- /themes/Core/Compare/templates/footer-comments: -------------------------------------------------------------------------------- 1 | 2 | This pattern is available under a Creative Commons Attribution license (CC-BY) 3 | 4 | https://creativecommons.org/licenses/by/3.0/ 5 | 6 | -------------------------------------------------------------------------------- /themes/Core/Compare/templates/header-comments: -------------------------------------------------------------------------------- 1 | __ _ 2 | / _|_ _ ___ ___ ________ __ _(_)_ _ __ _ 3 | | _| '_/ -_) -_|_-< -_) V V / | ' \/ _` | 4 | |_| |_| \___\___/__|___|\_/\_/|_|_||_\__, | 5 | freesewing.org |___/ 6 | -------------------------------------------------------------------------------- /themes/Core/Compare/templates/style.css: -------------------------------------------------------------------------------- 1 | path { fill: none; stroke: #000000; stroke-opacity:1; stroke-width: 0.5; stroke-miterlimit:4; stroke-dashoffset:0; stroke-linecap:round; stroke-linejoin:round; } 2 | path.hidden { fill: none; stroke: none; } 3 | path.compare { fill: #000000; fill-opacity: 0.05; stroke: #000000; stroke-opacity:0.5; stroke-width: 1; stroke-linecap:round; stroke-linejoin:round; } 4 | -------------------------------------------------------------------------------- /themes/Core/Compare/templates/svg-attributes: -------------------------------------------------------------------------------- 1 | xmlns="http://www.w3.org/2000/svg" 2 | xmlns:svg="http://www.w3.org/2000/svg" 3 | xmlns:xlink="http://www.w3.org/1999/xlink" 4 | xmlns:freesewing="http://freesewing.org/namespaces/freesewing" 5 | -------------------------------------------------------------------------------- /themes/Core/Designer/config.yml: -------------------------------------------------------------------------------- 1 | templates: 2 | js: 3 | - "js/designer.js" 4 | css: 5 | - "css/designer.css" 6 | defs: 7 | - "defs/designer" 8 | settings: 9 | partMargin: 10 10 | isPaperless: false 11 | options: 12 | - parts 13 | - forceParts 14 | - onlyPoints 15 | - markPoints 16 | -------------------------------------------------------------------------------- /themes/Core/Designer/templates/css/designer.css: -------------------------------------------------------------------------------- 1 | path.curve-control { 2 | stroke: #f0ad4e; 3 | stroke-width: 0.2; } 4 | 5 | path.debug { 6 | stroke: #d9534f; 7 | stroke-opacity: 0.4; 8 | stroke-width: 2; } 9 | 10 | .point { 11 | fill: none; 12 | stroke-width: 0.6; 13 | stroke: #f0ad4e; } 14 | 15 | text.tooltip { 16 | font-size: 3px; } 17 | -------------------------------------------------------------------------------- /themes/Core/Designer/templates/defs/designer: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /themes/Core/Designer/templates/js/designer.js: -------------------------------------------------------------------------------- 1 | function pointHover(id) { 2 | var point = document.getElementById(id); 3 | var cx = point.getAttribute('x'); 4 | var cy = point.getAttribute('y'); 5 | console.log('Point '+id+' ( '+cx+' , '+cy+' )'); 6 | var scale = 2; 7 | cx = cx-scale*cx; 8 | cy = cy-scale*cy; 9 | point.setAttribute("transform", 'matrix('+scale+', 0, 0, '+scale+', '+cx+', '+cy+')'); 10 | var tooltip = document.getElementById(id+'-tooltip'); 11 | tooltip.setAttribute("visibility", 'visible'); 12 | setTimeout(function(){ 13 | var point = document.getElementById(id); 14 | point.removeAttribute("transform", ''); 15 | var tooltip = document.getElementById(id+'-tooltip'); 16 | tooltip.setAttribute("visibility", 'hidden'); 17 | }, 1000); 18 | } 19 | -------------------------------------------------------------------------------- /themes/Core/Designer/templates/sass/designer.scss: -------------------------------------------------------------------------------- 1 | @import '../../../Theme/templates/sass/variables'; 2 | 3 | path.curve-control { 4 | stroke: $color-mark; 5 | stroke-width: $stroke-sm; 6 | } 7 | 8 | path.debug { 9 | stroke: $red; 10 | stroke-opacity: 0.4; 11 | stroke-width: $stroke-xxl; 12 | } 13 | 14 | .point { 15 | fill: none; 16 | stroke-width: $stroke-lg; 17 | stroke: $color-mark; 18 | } 19 | text.tooltip { 20 | font-size: $font-xs; 21 | } 22 | 23 | -------------------------------------------------------------------------------- /themes/Core/Designerless/Designerless.php: -------------------------------------------------------------------------------- 1 | 11 | * @copyright 2016 Joost De Cock 12 | * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, Version 3 13 | */ 14 | class Designerless extends Designer { } 15 | -------------------------------------------------------------------------------- /themes/Core/Designerless/config.yml: -------------------------------------------------------------------------------- 1 | settings: 2 | partMargin: 10 3 | isPaperless: true 4 | options: 5 | - parts 6 | - forceParts 7 | - onlyPoints 8 | - markPoints 9 | -------------------------------------------------------------------------------- /themes/Core/Developer/Developer.php: -------------------------------------------------------------------------------- 1 | 12 | * @copyright 2016 Joost De Cock 13 | * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, Version 3 14 | */ 15 | class Developer extends Theme 16 | { 17 | 18 | /** 19 | * Outputs (the entire context object as Kint debug + SVG) as JSON 20 | * 21 | * @param \Freesewing\Context $context The context object 22 | * 23 | * @return \Freesewing\Response $response The response object with Kint+SVG 24 | */ 25 | public function themeResponse(Context $context) 26 | { 27 | ob_start(); 28 | // \Kint::$maxLevels = 0; 29 | + \Kint::dump($context); 30 | $debug = ob_get_clean(); 31 | 32 | $response = new \Freesewing\Response(); 33 | $response->setFormat('json'); 34 | $response->setBody([ 35 | 'svg' => "{$context->getSvgDocument()}", 36 | 'debug' => $debug, 37 | ]); 38 | 39 | return $response; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /themes/Core/Developer/config.yml: -------------------------------------------------------------------------------- 1 | settings: 2 | partMargin: 5 3 | isPaperless: true 4 | options: 5 | - parts 6 | - forceParts 7 | - embedFluid 8 | -------------------------------------------------------------------------------- /themes/Core/Info/templates/footer-comments: -------------------------------------------------------------------------------- 1 | 2 | This pattern is available under a Creative Commons Attribution license (CC-BY) 3 | 4 | https://creativecommons.org/licenses/by/3.0/ 5 | 6 | -------------------------------------------------------------------------------- /themes/Core/Info/templates/header-comments: -------------------------------------------------------------------------------- 1 | 2 | __ _ 3 | / _|_ _ ___ ___ ________ __ _(_)_ _ __ _ 4 | | _| '_/ -_) -_|_-< -_) V V / | ' \/ _` | 5 | |_| |_| \___\___/__|___|\_/\_/|_|_||_\__, | 6 | freesewing.org |___/ 7 | 8 | 9 | SVG generated by freesewing: freesewing.org 10 | 11 | -------------------------------------------------------------------------------- /themes/Core/Info/templates/style.css: -------------------------------------------------------------------------------- 1 | path { fill: none; stroke: #000000; stroke-opacity:1; stroke-width: 0.5; stroke-miterlimit:4; stroke-dashoffset:0; stroke-linecap:round; stroke-linejoin:round; } 2 | path.hidden { fill: none; stroke: none; } 3 | -------------------------------------------------------------------------------- /themes/Core/Info/templates/svg-attributes: -------------------------------------------------------------------------------- 1 | xmlns:dc="http://purl.org/dc/elements/1.1/" 2 | xmlns:cc="http://creativecommons.org/ns#" 3 | xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 4 | xmlns:svg="http://www.w3.org/2000/svg" 5 | xmlns="http://www.w3.org/2000/svg" 6 | xmlns:xlink="http://www.w3.org/1999/xlink" 7 | xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" 8 | xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" 9 | -------------------------------------------------------------------------------- /themes/Core/Paperless/config.yml: -------------------------------------------------------------------------------- 1 | templates: 2 | css: 3 | - "css/paperless.css" 4 | settings: 5 | partMargin: 15 6 | gridMargin: 10 7 | isPaperless: true 8 | 9 | options: 10 | - parts 11 | - forceParts 12 | - embedFluid 13 | -------------------------------------------------------------------------------- /themes/Core/Paperless/templates/css/paperless.css: -------------------------------------------------------------------------------- 1 | rect.grid { 2 | fill: none; 3 | stroke: #555; 4 | stroke-width: 0.3; 5 | fill: url(#grid); } 6 | 7 | path.gridline { 8 | stroke: #555; 9 | stroke-width: 0.2; } 10 | 11 | path.gridline-lg { 12 | stroke: #777; 13 | stroke-width: 0.2; 14 | stroke-dasharray: 1.5,1.5; } 15 | 16 | path.gridline-sm { 17 | stroke: #999; 18 | stroke-width: 0.1; } 19 | 20 | path.gridline-xs { 21 | stroke: #999; 22 | stroke-width: 0.1; 23 | stroke-dasharray: 0.5,0.5; } 24 | -------------------------------------------------------------------------------- /themes/Core/Paperless/templates/defs/grid.imperial: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /themes/Core/Paperless/templates/defs/grid.metric: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /themes/Core/Paperless/templates/sass/paperless.scss: -------------------------------------------------------------------------------- 1 | @import '../../../Theme/templates/sass/variables'; 2 | @import 'variables'; 3 | 4 | rect.grid { 5 | fill: none; 6 | stroke: $grid-gray1; 7 | stroke-width: $grid-stroke; 8 | fill:url(#grid); 9 | } 10 | path.gridline { 11 | stroke: $grid-gray1; 12 | stroke-width: $grid-stroke-sm; 13 | } 14 | 15 | path.gridline-lg { 16 | stroke: $grid-gray2; 17 | stroke-width: $grid-stroke-sm; 18 | stroke-dasharray: 1.5,1.5; 19 | } 20 | 21 | path.gridline-sm { 22 | stroke: $grid-gray3; 23 | stroke-width: $grid-stroke-xs; 24 | } 25 | 26 | path.gridline-xs { 27 | stroke: $grid-gray3; 28 | stroke-width: $grid-stroke-xs; 29 | stroke-dasharray: 0.5,0.5; 30 | } 31 | -------------------------------------------------------------------------------- /themes/Core/Paperless/templates/sass/variables.scss: -------------------------------------------------------------------------------- 1 | $grid-stroke-xs: 0.1; 2 | $grid-stroke-sm: 0.2; 3 | $grid-stroke: 0.3; 4 | 5 | $grid-gray1: #555; 6 | $grid-gray2: #777; 7 | $grid-gray3: #999; 8 | -------------------------------------------------------------------------------- /themes/Core/PaperlessJson/PaperlessJson.php: -------------------------------------------------------------------------------- 1 | 11 | * @copyright 2018 Joost De Cock 12 | * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, Version 3 13 | */ 14 | class PaperlessJson extends Paperless 15 | { 16 | /** 17 | * Outputs the pattern + info as JSON 18 | * 19 | * @param \Freesewing\Context $context The context object 20 | * 21 | * @return \Freesewing\Response $response The response object 22 | */ 23 | public function themeResponse(Context $context) 24 | { 25 | $response = new \Freesewing\Response(); 26 | $response->setFormat('json'); 27 | $response->setBody([ 28 | 'svg' => "{$context->getSvgDocument()}", 29 | 'version' => $context->getPattern()->getVersion(), 30 | ]); 31 | 32 | return $response; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /themes/Core/PaperlessJson/config.yml: -------------------------------------------------------------------------------- 1 | settings: 2 | partMargin: 15 3 | gridMargin: 10 4 | isPaperless: true 5 | 6 | options: 7 | - parts 8 | - forceParts 9 | - embedFluid 10 | -------------------------------------------------------------------------------- /themes/Core/PaperlessJson/templates/css/paperless.css: -------------------------------------------------------------------------------- 1 | rect.grid { 2 | fill: none; 3 | stroke: #555; 4 | stroke-width: 0.3; 5 | fill: url(#grid); } 6 | 7 | path.gridline { 8 | stroke: #555; 9 | stroke-width: 0.2; } 10 | 11 | path.gridline-lg { 12 | stroke: #777; 13 | stroke-width: 0.2; 14 | stroke-dasharray: 1.5,1.5; } 15 | 16 | path.gridline-sm { 17 | stroke: #999; 18 | stroke-width: 0.1; } 19 | 20 | path.gridline-xs { 21 | stroke: #999; 22 | stroke-width: 0.1; 23 | stroke-dasharray: 0.5,0.5; } 24 | -------------------------------------------------------------------------------- /themes/Core/PaperlessJson/templates/defs/grid.imperial: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /themes/Core/PaperlessJson/templates/defs/grid.metric: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /themes/Core/PaperlessJson/templates/sass/paperless.scss: -------------------------------------------------------------------------------- 1 | @import '../../../Theme/templates/sass/variables'; 2 | @import 'variables'; 3 | 4 | rect.grid { 5 | fill: none; 6 | stroke: $grid-gray1; 7 | stroke-width: $grid-stroke; 8 | fill:url(#grid); 9 | } 10 | path.gridline { 11 | stroke: $grid-gray1; 12 | stroke-width: $grid-stroke-sm; 13 | } 14 | 15 | path.gridline-lg { 16 | stroke: $grid-gray2; 17 | stroke-width: $grid-stroke-sm; 18 | stroke-dasharray: 1.5,1.5; 19 | } 20 | 21 | path.gridline-sm { 22 | stroke: $grid-gray3; 23 | stroke-width: $grid-stroke-xs; 24 | } 25 | 26 | path.gridline-xs { 27 | stroke: $grid-gray3; 28 | stroke-width: $grid-stroke-xs; 29 | stroke-dasharray: 0.5,0.5; 30 | } 31 | -------------------------------------------------------------------------------- /themes/Core/PaperlessJson/templates/sass/variables.scss: -------------------------------------------------------------------------------- 1 | $grid-stroke-xs: 0.1; 2 | $grid-stroke-sm: 0.2; 3 | $grid-stroke: 0.3; 4 | 5 | $grid-gray1: #555; 6 | $grid-gray2: #777; 7 | $grid-gray3: #999; 8 | -------------------------------------------------------------------------------- /themes/Core/Sampler/Sampler.php: -------------------------------------------------------------------------------- 1 | 11 | * @copyright 2016 Joost De Cock 12 | * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, Version 3 13 | */ 14 | class Sampler extends Theme 15 | { 16 | /** 17 | * Adds SVG and attributes to the SvgDocument 18 | * 19 | * @param \Freesewing\SvgDocument $svgDocument The SVG document 20 | */ 21 | public function themeSvg(\Freesewing\SvgDocument $svgDocument) 22 | { 23 | $dir = $this->getTemplateDir(); 24 | $svgDocument->css->add(file_get_contents("$dir/style.css")); 25 | $svgDocument->svgAttributes->add(file_get_contents("$dir/svg-attributes")); 26 | } 27 | 28 | /** 29 | * Returns a stroke attribute based on the current step and total steps 30 | * 31 | * @param int $step Current step (in the sampler) 32 | * @param int $steps Total steps (in the sampler) 33 | * 34 | * @return string $attr The stroke attribute 35 | */ 36 | public function samplerPathStyle($step, $totalSteps) 37 | { 38 | $color = $this->pickColor($step, $totalSteps); 39 | 40 | return "stroke: $color;"; 41 | } 42 | 43 | /** 44 | * Returns a color based on the current step and total steps 45 | * 46 | * @param int $step Current step (in the sampler) 47 | * @param int $steps Total steps (in the sampler) 48 | * 49 | * @return string $color A HSL color notation 50 | */ 51 | private function pickColor($step, $steps) 52 | { 53 | if ($steps == 1) { 54 | $hue = 269; 55 | } else { 56 | $hue = $step * (269 / ($steps - 1)); 57 | } 58 | $saturation = 55; 59 | $lightness = 50; 60 | 61 | return "hsl($hue, $saturation%, $lightness%)"; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /themes/Core/Sampler/config.yml: -------------------------------------------------------------------------------- 1 | settings: 2 | partMargin: 5 3 | isPaperless: false 4 | 5 | options: 6 | - parts 7 | - forceParts 8 | - embedFluid 9 | -------------------------------------------------------------------------------- /themes/Core/Sampler/templates/footer-comments: -------------------------------------------------------------------------------- 1 | 2 | This pattern is available under a Creative Commons Attribution license (CC-BY) 3 | 4 | https://creativecommons.org/licenses/by/3.0/ 5 | 6 | -------------------------------------------------------------------------------- /themes/Core/Sampler/templates/header-comments: -------------------------------------------------------------------------------- 1 | __ _ 2 | / _|_ _ ___ ___ ________ __ _(_)_ _ __ _ 3 | | _| '_/ -_) -_|_-< -_) V V / | ' \/ _` | 4 | |_| |_| \___\___/__|___|\_/\_/|_|_||_\__, | 5 | freesewing.org |___/ 6 | -------------------------------------------------------------------------------- /themes/Core/Sampler/templates/style.css: -------------------------------------------------------------------------------- 1 | path { fill: none; stroke: #000000; stroke-opacity:1; stroke-width: 0.5; stroke-miterlimit:4; stroke-dashoffset:0; stroke-linecap:round; stroke-linejoin:round; } 2 | path.hidden { fill: none; stroke: none; } 3 | -------------------------------------------------------------------------------- /themes/Core/Sampler/templates/svg-attributes: -------------------------------------------------------------------------------- 1 | xmlns="http://www.w3.org/2000/svg" 2 | xmlns:svg="http://www.w3.org/2000/svg" 3 | xmlns:xlink="http://www.w3.org/1999/xlink" 4 | xmlns:freesewing="http://freesewing.org/namespaces/freesewing" 5 | -------------------------------------------------------------------------------- /themes/Core/Theme/config.yml: -------------------------------------------------------------------------------- 1 | templates: 2 | css: 3 | - "css/style.css" 4 | defs: 5 | - "defs/base" 6 | - "defs/scalebox" 7 | - "defs/logo" 8 | - "defs/buttons" 9 | - "defs/buttonholes" 10 | - "defs/snaps" 11 | footer: 12 | - "comments/footer" 13 | header: 14 | - "comments/header" 15 | attributes: 16 | - "attributes/svg" 17 | 18 | settings: 19 | partMargin: 5 20 | isPaperless: false 21 | 22 | options: 23 | - parts 24 | - forceParts 25 | - embedFluid 26 | -------------------------------------------------------------------------------- /themes/Core/Theme/templates/attributes/svg: -------------------------------------------------------------------------------- 1 | xmlns="http://www.w3.org/2000/svg" 2 | xmlns:svg="http://www.w3.org/2000/svg" 3 | xmlns:xlink="http://www.w3.org/1999/xlink" 4 | xmlns:freesewing="http://freesewing.org/namespaces/freesewing" 5 | -------------------------------------------------------------------------------- /themes/Core/Theme/templates/comments/footer: -------------------------------------------------------------------------------- 1 | An open source platform 2 | for made-to-measure sewing patterns 3 | -------------------------------------------------------------------------------- /themes/Core/Theme/templates/comments/header: -------------------------------------------------------------------------------- 1 | __ _ 2 | / _|_ _ ___ ___ ________ __ _(_)_ _ __ _ 3 | | _| '_/ -_) -_|_-< -_) V V / | ' \/ _` | 4 | |_| |_| \___\___/__|___|\_/\_/|_|_||_\__, | 5 | freesewing.org |___/ 6 | 7 | -------------------------------------------------------------------------------- /themes/Core/Theme/templates/defs/base: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /themes/Core/Theme/templates/defs/buttonholes: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /themes/Core/Theme/templates/defs/buttons: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /themes/Core/Theme/templates/defs/scalebox: -------------------------------------------------------------------------------- 1 | freesewing core v__VERSION__ __TITLE__ freesewing.org/drafts/__DRAFTHANDLE__ __SCALEBOX_METRIC__ __SCALEBOX_IMPERIAL__ 2 | -------------------------------------------------------------------------------- /themes/Core/Theme/templates/defs/snaps: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /themes/Core/Theme/templates/sass/variables.scss: -------------------------------------------------------------------------------- 1 | // Colors 2 | $red: #d9534f !default; 3 | $orange: #f0ad4e !default; 4 | $yellow: #ffd500 !default; 5 | $green: #5cb85c !default; 6 | $blue: #0275d8 !default; 7 | $teal: #5bc0de !default; 8 | $pink: #ff5b77 !default; 9 | $purple: #653f95 !default; 10 | $light-purple: #86739c !default; 11 | 12 | // Grayscale 13 | $white: #fff !default; 14 | $black: #000 !default; 15 | $gray: #999 !default; 16 | 17 | // Semantic color scheme 18 | $color-fabric: $purple !default; 19 | $color-lining: $blue !default; 20 | $color-interfacing: $red !default; 21 | $color-canvas: $green !default; 22 | $color-various: $teal !default; 23 | $color-note: $blue !default; 24 | $color-mark: $orange !default; 25 | $color-hint: $light-purple !default; 26 | 27 | // Fonts 28 | $font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !default; 29 | $font-xs: 3px; 30 | $font-sm: 4px; 31 | $font: 5px; 32 | $font-lg: 7px; 33 | $font-xl: 9px; 34 | $font-xxl: 12px; 35 | 36 | // Part titles 37 | $font-part-nr: 28px; 38 | $font-part-title: 18px; 39 | $font-pattern-title: 8px; 40 | $font-part-subtitle: 10px; 41 | $font-part-nr-sm: 14px; 42 | $font-part-title-sm: 9px; 43 | $font-pattern-title-sm: 4px; 44 | $font-part-subtitle-sm: 5px; 45 | $font-part-nr-xs: 7px; 46 | $font-part-title-xs: 5px; 47 | $font-pattern-title-xs: 3px; 48 | $font-part-subtitle-xs: 4px; 49 | 50 | // Stoke width 51 | $stroke-xs: 0.1; 52 | $stroke-sm: 0.2; 53 | $stroke: 0.3; 54 | $stroke-lg: 0.6; 55 | $stroke-xl: 1; 56 | $stroke-xxl: 2; 57 | 58 | // Dash arrays 59 | $dashes: 1,1.5; 60 | $lashes: 6,6; 61 | $stripedashes: 15,1.5,1,1.5; 62 | $dots: 0.4,0.8; 63 | -------------------------------------------------------------------------------- /themes/Core/Theme/translations/messages.de.yml: -------------------------------------------------------------------------------- 1 | __SCALEBOX_METRIC__: "Die Abmessungen der (weißen) Innenseite dieser Box sollten 10 x 5cm betragen." 2 | __SCALEBOX_IMPERIAL__: "Die Abmessungen der (schwarzen) Außenseite dieser Box sollten 4 x 2 inch betragen." -------------------------------------------------------------------------------- /themes/Core/Theme/translations/messages.en.yml: -------------------------------------------------------------------------------- 1 | __SCALEBOX_METRIC__: "The (white) inside of this box should measure 10 by 5 cm" 2 | __SCALEBOX_IMPERIAL__: "The (black) outside of this box should measure 4 by 2 inch" 3 | -------------------------------------------------------------------------------- /themes/Core/Theme/translations/messages.fr.yml: -------------------------------------------------------------------------------- 1 | __SCALEBOX_METRIC__: "L'intérieur de cette boîte (en blanc) devrait mesurer 10 x 5 cm" 2 | __SCALEBOX_IMPERIAL__: "L'extérieur de cette boîte (en noir) devrait mesurer 4\" x 2\"" 3 | -------------------------------------------------------------------------------- /themes/Core/Theme/translations/messages.nl.yml: -------------------------------------------------------------------------------- 1 | __SCALEBOX_METRIC__: "De (witte) binnenkant van deze rechthoek meet 10cm op 5cm" 2 | __SCALEBOX_IMPERIAL__: "De (zwarte) buitenkant van deze rechthoek meet 4 duim op 2 duim" 3 | --------------------------------------------------------------------------------