@guilhermebkel/scenec 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -22
- package/dist/Adapters/FileReaderAdapter.d.ts +4 -0
- package/dist/Adapters/FileReaderAdapter.js +21 -0
- package/dist/Adapters/FontAdapter.d.ts +5 -0
- package/dist/Adapters/FontAdapter.js +9 -0
- package/dist/Adapters/ResvgAdapter.d.ts +11 -0
- package/dist/Adapters/ResvgAdapter.js +18 -0
- package/dist/Commands/BaseCommand.d.ts +11 -0
- package/dist/Commands/BaseCommand.js +13 -0
- package/dist/Commands/CatalogCommand.d.ts +6 -0
- package/dist/Commands/CatalogCommand.js +24 -0
- package/dist/Commands/CheckCommand.d.ts +5 -0
- package/dist/Commands/CheckCommand.js +8 -0
- package/dist/Commands/RenderCommand.d.ts +5 -0
- package/dist/Commands/RenderCommand.js +8 -0
- package/dist/Commands/SceneCommand.d.ts +11 -0
- package/dist/Commands/SceneCommand.js +70 -0
- package/dist/Commands/SchemaCommand.d.ts +5 -0
- package/dist/Commands/SchemaCommand.js +12 -0
- package/dist/Data/cities.json +312 -0
- package/dist/Data/europe.json +1 -0
- package/dist/Errors/SceneError.d.ts +4 -0
- package/dist/Errors/SceneError.js +11 -0
- package/dist/Errors/UnsafeSvgError.d.ts +3 -0
- package/dist/Errors/UnsafeSvgError.js +9 -0
- package/dist/Modules/CheckModule.d.ts +8 -0
- package/dist/Modules/CheckModule.js +16 -0
- package/dist/Modules/CompilationModule.d.ts +18 -0
- package/dist/Modules/CompilationModule.js +137 -0
- package/dist/Modules/CritiqueModule.d.ts +6 -0
- package/dist/Modules/CritiqueModule.js +43 -0
- package/dist/Modules/MapModule.d.ts +24 -0
- package/dist/Modules/MapModule.js +99 -0
- package/dist/Modules/ParsingModule.d.ts +17 -0
- package/dist/Modules/ParsingModule.js +88 -0
- package/dist/Modules/PlaneModule.d.ts +19 -0
- package/dist/Modules/PlaneModule.js +98 -0
- package/dist/Protocols/AssetProtocol.d.ts +62 -0
- package/dist/Protocols/AssetProtocol.js +93 -0
- package/dist/Protocols/CommandProtocol.d.ts +6 -0
- package/dist/Protocols/CommandProtocol.js +0 -0
- package/dist/Protocols/CompilationProtocol.d.ts +110 -0
- package/dist/Protocols/CompilationProtocol.js +0 -0
- package/dist/Protocols/CritiqueProtocol.d.ts +42 -0
- package/dist/Protocols/CritiqueProtocol.js +4 -0
- package/dist/Protocols/CustomAssetProtocol.d.ts +24 -0
- package/dist/Protocols/CustomAssetProtocol.js +0 -0
- package/dist/Protocols/GroupProtocol.d.ts +17 -0
- package/dist/Protocols/GroupProtocol.js +12 -0
- package/dist/Protocols/KitProtocol.d.ts +26 -0
- package/dist/Protocols/KitProtocol.js +17 -0
- package/dist/Protocols/MapProtocol.d.ts +77 -0
- package/dist/Protocols/MapProtocol.js +4 -0
- package/dist/Protocols/OptionsProtocol.js +0 -0
- package/dist/Protocols/PersonProtocol.d.ts +64 -0
- package/dist/Protocols/PersonProtocol.js +40 -0
- package/dist/Protocols/PlaneProtocol.d.ts +140 -0
- package/dist/Protocols/PlaneProtocol.js +4 -0
- package/dist/{pipeline/index.d.ts → Protocols/ResultProtocol.d.ts} +0 -2
- package/dist/Protocols/ResultProtocol.js +0 -0
- package/dist/Protocols/SceneProtocol.d.ts +625 -0
- package/dist/Protocols/SceneProtocol.js +304 -0
- package/dist/{protocols/theme.d.ts → Protocols/ThemeProtocol.d.ts} +4 -0
- package/dist/Protocols/ThemeProtocol.js +28 -0
- package/dist/Resources/Assets/BackpackAsset.d.ts +10 -0
- package/dist/Resources/Assets/BackpackAsset.js +31 -0
- package/dist/Resources/Assets/BallAsset.d.ts +10 -0
- package/dist/Resources/Assets/BallAsset.js +15 -0
- package/dist/Resources/Assets/BalloonsAsset.d.ts +10 -0
- package/dist/Resources/Assets/BalloonsAsset.js +26 -0
- package/dist/Resources/Assets/BaseAsset.d.ts +16 -0
- package/dist/Resources/Assets/BaseAsset.js +10 -0
- package/dist/Resources/Assets/BeachTowelAsset.d.ts +10 -0
- package/dist/Resources/Assets/BeachTowelAsset.js +14 -0
- package/dist/Resources/Assets/BedAsset.d.ts +12 -0
- package/dist/Resources/Assets/BedAsset.js +25 -0
- package/dist/Resources/Assets/BenchAsset.d.ts +11 -0
- package/dist/Resources/Assets/BenchAsset.js +24 -0
- package/dist/Resources/Assets/BicycleAsset.d.ts +10 -0
- package/dist/Resources/Assets/BicycleAsset.js +18 -0
- package/dist/Resources/Assets/BigPlantAsset.d.ts +10 -0
- package/dist/Resources/Assets/BigPlantAsset.js +19 -0
- package/dist/Resources/Assets/BirdAsset.d.ts +10 -0
- package/dist/Resources/Assets/BirdAsset.js +14 -0
- package/dist/Resources/Assets/BoardAsset.d.ts +12 -0
- package/dist/Resources/Assets/BoardAsset.js +44 -0
- package/dist/Resources/Assets/BoatAsset.d.ts +10 -0
- package/dist/Resources/Assets/BoatAsset.js +15 -0
- package/dist/Resources/Assets/BooksAsset.d.ts +10 -0
- package/dist/Resources/Assets/BooksAsset.js +35 -0
- package/dist/Resources/Assets/BookshelfAsset.d.ts +10 -0
- package/dist/Resources/Assets/BookshelfAsset.js +33 -0
- package/dist/Resources/Assets/BuildingAsset.d.ts +14 -0
- package/dist/Resources/Assets/BuildingAsset.js +34 -0
- package/dist/Resources/Assets/BurgerAsset.d.ts +9 -0
- package/dist/Resources/Assets/BurgerAsset.js +23 -0
- package/dist/Resources/Assets/BushAsset.d.ts +10 -0
- package/dist/Resources/Assets/BushAsset.js +17 -0
- package/dist/Resources/Assets/CabinetAsset.d.ts +14 -0
- package/dist/Resources/Assets/CabinetAsset.js +49 -0
- package/dist/Resources/Assets/CablesAsset.d.ts +10 -0
- package/dist/Resources/Assets/CablesAsset.js +16 -0
- package/dist/Resources/Assets/CakeAsset.d.ts +10 -0
- package/dist/Resources/Assets/CakeAsset.js +29 -0
- package/dist/Resources/Assets/CapAsset.d.ts +10 -0
- package/dist/Resources/Assets/CapAsset.js +18 -0
- package/dist/Resources/Assets/CarAsset.d.ts +10 -0
- package/dist/Resources/Assets/CarAsset.js +29 -0
- package/dist/Resources/Assets/CatAsset.d.ts +10 -0
- package/dist/Resources/Assets/CatAsset.js +17 -0
- package/dist/Resources/Assets/ChairAsset.d.ts +11 -0
- package/dist/Resources/Assets/ChairAsset.js +32 -0
- package/dist/Resources/Assets/ClockAsset.d.ts +11 -0
- package/dist/Resources/Assets/ClockAsset.js +22 -0
- package/dist/Resources/Assets/CloudAsset.d.ts +10 -0
- package/dist/Resources/Assets/CloudAsset.js +15 -0
- package/dist/Resources/Assets/CoffeeMachineAsset.d.ts +10 -0
- package/dist/Resources/Assets/CoffeeMachineAsset.js +23 -0
- package/dist/Resources/Assets/CounterAsset.d.ts +11 -0
- package/dist/Resources/Assets/CounterAsset.js +29 -0
- package/dist/Resources/Assets/CupAsset.d.ts +10 -0
- package/dist/Resources/Assets/CupAsset.js +17 -0
- package/dist/Resources/Assets/CustomAsset.d.ts +25 -0
- package/dist/Resources/Assets/CustomAsset.js +58 -0
- package/dist/Resources/Assets/DeskAsset.d.ts +11 -0
- package/dist/Resources/Assets/DeskAsset.js +35 -0
- package/dist/Resources/Assets/DeskSlabAsset.d.ts +18 -0
- package/dist/Resources/Assets/DeskSlabAsset.js +43 -0
- package/dist/Resources/Assets/DiplomaAsset.d.ts +10 -0
- package/dist/Resources/Assets/DiplomaAsset.js +23 -0
- package/dist/Resources/Assets/DogAsset.d.ts +10 -0
- package/dist/Resources/Assets/DogAsset.js +24 -0
- package/dist/Resources/Assets/DrawerUnitAsset.d.ts +14 -0
- package/dist/Resources/Assets/DrawerUnitAsset.js +35 -0
- package/dist/Resources/Assets/FenceAsset.d.ts +10 -0
- package/dist/Resources/Assets/FenceAsset.js +26 -0
- package/dist/Resources/Assets/FigurineAsset.d.ts +10 -0
- package/dist/Resources/Assets/FigurineAsset.js +24 -0
- package/dist/Resources/Assets/FinishFlagAsset.d.ts +10 -0
- package/dist/Resources/Assets/FinishFlagAsset.js +21 -0
- package/dist/Resources/Assets/FloorLampAsset.d.ts +10 -0
- package/dist/Resources/Assets/FloorLampAsset.js +22 -0
- package/dist/Resources/Assets/FlowersAsset.d.ts +10 -0
- package/dist/Resources/Assets/FlowersAsset.js +37 -0
- package/dist/Resources/Assets/FrameAsset.d.ts +11 -0
- package/dist/Resources/Assets/FrameAsset.js +24 -0
- package/dist/Resources/Assets/FruitBowlAsset.d.ts +10 -0
- package/dist/Resources/Assets/FruitBowlAsset.js +16 -0
- package/dist/Resources/Assets/GlassShelfAsset.d.ts +17 -0
- package/dist/Resources/Assets/GlassShelfAsset.js +25 -0
- package/dist/Resources/Assets/HeadphonesAsset.d.ts +10 -0
- package/dist/Resources/Assets/HeadphonesAsset.js +23 -0
- package/dist/Resources/Assets/HouseAsset.d.ts +10 -0
- package/dist/Resources/Assets/HouseAsset.js +42 -0
- package/dist/Resources/Assets/LabAsset.d.ts +10 -0
- package/dist/Resources/Assets/LabAsset.js +52 -0
- package/dist/Resources/Assets/LampAsset.d.ts +10 -0
- package/dist/Resources/Assets/LampAsset.js +16 -0
- package/dist/Resources/Assets/LaptopAsset.d.ts +10 -0
- package/dist/Resources/Assets/LaptopAsset.js +23 -0
- package/dist/Resources/Assets/LaptopOpenAsset.d.ts +10 -0
- package/dist/Resources/Assets/LaptopOpenAsset.js +29 -0
- package/dist/Resources/Assets/LightSwitchAsset.d.ts +11 -0
- package/dist/Resources/Assets/LightSwitchAsset.js +24 -0
- package/dist/Resources/Assets/MonitorAsset.d.ts +10 -0
- package/dist/Resources/Assets/MonitorAsset.js +40 -0
- package/dist/Resources/Assets/MoonAsset.d.ts +10 -0
- package/dist/Resources/Assets/MoonAsset.js +16 -0
- package/dist/Resources/Assets/MountainAsset.d.ts +10 -0
- package/dist/Resources/Assets/MountainAsset.js +15 -0
- package/dist/Resources/Assets/OfficeChairAsset.d.ts +10 -0
- package/dist/Resources/Assets/OfficeChairAsset.js +45 -0
- package/dist/Resources/Assets/PalmAsset.d.ts +10 -0
- package/dist/Resources/Assets/PalmAsset.js +32 -0
- package/dist/Resources/Assets/PaperCupAsset.d.ts +10 -0
- package/dist/Resources/Assets/PaperCupAsset.js +17 -0
- package/dist/Resources/Assets/PendantLampAsset.d.ts +10 -0
- package/dist/Resources/Assets/PendantLampAsset.js +16 -0
- package/dist/Resources/Assets/PennantAsset.d.ts +10 -0
- package/dist/Resources/Assets/PennantAsset.js +15 -0
- package/dist/Resources/Assets/PersonAsset.d.ts +10 -0
- package/dist/Resources/Assets/PersonAsset.js +15 -0
- package/dist/Resources/Assets/PhotoFrameAsset.d.ts +15 -0
- package/dist/Resources/Assets/PhotoFrameAsset.js +68 -0
- package/dist/Resources/Assets/PineAsset.d.ts +10 -0
- package/dist/Resources/Assets/PineAsset.js +21 -0
- package/dist/Resources/Assets/PizzaAsset.d.ts +10 -0
- package/dist/Resources/Assets/PizzaAsset.js +17 -0
- package/dist/Resources/Assets/PlantAsset.d.ts +10 -0
- package/dist/Resources/Assets/PlantAsset.js +17 -0
- package/dist/Resources/Assets/PlasticBagAsset.d.ts +10 -0
- package/dist/Resources/Assets/PlasticBagAsset.js +15 -0
- package/dist/Resources/Assets/PlateAsset.d.ts +10 -0
- package/dist/Resources/Assets/PlateAsset.js +17 -0
- package/dist/Resources/Assets/RollingCartAsset.d.ts +11 -0
- package/dist/Resources/Assets/RollingCartAsset.js +34 -0
- package/dist/Resources/Assets/RugAsset.d.ts +10 -0
- package/dist/Resources/Assets/RugAsset.js +19 -0
- package/dist/Resources/Assets/SandcastleAsset.d.ts +10 -0
- package/dist/Resources/Assets/SandcastleAsset.js +30 -0
- package/dist/Resources/Assets/SchoolAsset.d.ts +10 -0
- package/dist/Resources/Assets/SchoolAsset.js +32 -0
- package/dist/Resources/Assets/ShelfWallAsset.d.ts +11 -0
- package/dist/Resources/Assets/ShelfWallAsset.js +23 -0
- package/dist/Resources/Assets/SofaAsset.d.ts +11 -0
- package/dist/Resources/Assets/SofaAsset.js +38 -0
- package/dist/Resources/Assets/StageAsset.d.ts +10 -0
- package/dist/Resources/Assets/StageAsset.js +44 -0
- package/dist/Resources/Assets/StarAsset.d.ts +10 -0
- package/dist/Resources/Assets/StarAsset.js +14 -0
- package/dist/Resources/Assets/StarsAsset.d.ts +11 -0
- package/dist/Resources/Assets/StarsAsset.js +42 -0
- package/dist/Resources/Assets/StreetlightAsset.d.ts +10 -0
- package/dist/Resources/Assets/StreetlightAsset.js +20 -0
- package/dist/Resources/Assets/SuitcaseAsset.d.ts +10 -0
- package/dist/Resources/Assets/SuitcaseAsset.js +42 -0
- package/dist/Resources/Assets/SunAsset.d.ts +10 -0
- package/dist/Resources/Assets/SunAsset.js +22 -0
- package/dist/Resources/Assets/TableAsset.d.ts +15 -0
- package/dist/Resources/Assets/TableAsset.js +21 -0
- package/dist/Resources/Assets/TrashCanAsset.d.ts +10 -0
- package/dist/Resources/Assets/TrashCanAsset.js +31 -0
- package/dist/Resources/Assets/TreeAsset.d.ts +10 -0
- package/dist/Resources/Assets/TreeAsset.js +23 -0
- package/dist/Resources/Assets/TrophyAsset.d.ts +10 -0
- package/dist/Resources/Assets/TrophyAsset.js +16 -0
- package/dist/Resources/Assets/TumblerAsset.d.ts +10 -0
- package/dist/Resources/Assets/TumblerAsset.js +17 -0
- package/dist/Resources/Assets/TvAsset.d.ts +10 -0
- package/dist/Resources/Assets/TvAsset.js +29 -0
- package/dist/Resources/Assets/TvStandAsset.d.ts +11 -0
- package/dist/Resources/Assets/TvStandAsset.js +34 -0
- package/dist/Resources/Assets/UmbrellaAsset.d.ts +10 -0
- package/dist/Resources/Assets/UmbrellaAsset.js +17 -0
- package/dist/Resources/Assets/UniversityAsset.d.ts +10 -0
- package/dist/Resources/Assets/UniversityAsset.js +22 -0
- package/dist/Resources/Assets/VaseFlowersAsset.d.ts +10 -0
- package/dist/Resources/Assets/VaseFlowersAsset.js +16 -0
- package/dist/Resources/Assets/WindowAsset.d.ts +11 -0
- package/dist/Resources/Assets/WindowAsset.js +32 -0
- package/dist/Resources/Groups/BaseGroup.d.ts +7 -0
- package/dist/Resources/Groups/BaseGroup.js +5 -0
- package/dist/Resources/Groups/CelebrationGroup.d.ts +8 -0
- package/dist/Resources/Groups/CelebrationGroup.js +19 -0
- package/dist/Resources/Groups/ConversationGroup.d.ts +9 -0
- package/dist/Resources/Groups/ConversationGroup.js +17 -0
- package/dist/Resources/Groups/DiningGroup.d.ts +8 -0
- package/dist/Resources/Groups/DiningGroup.js +21 -0
- package/dist/Resources/Groups/MeetingGroup.d.ts +8 -0
- package/dist/Resources/Groups/MeetingGroup.js +22 -0
- package/dist/Resources/Groups/ParkBenchGroup.d.ts +8 -0
- package/dist/Resources/Groups/ParkBenchGroup.js +17 -0
- package/dist/Resources/Groups/ReadingCornerGroup.d.ts +8 -0
- package/dist/Resources/Groups/ReadingCornerGroup.js +17 -0
- package/dist/Resources/Groups/WorkspaceGroup.d.ts +10 -0
- package/dist/Resources/Groups/WorkspaceGroup.js +25 -0
- package/dist/Resources/Kits/BaseKit.d.ts +12 -0
- package/dist/Resources/Kits/BaseKit.js +11 -0
- package/dist/Resources/Kits/FlatKit.d.ts +5 -0
- package/dist/Resources/Kits/FlatKit.js +8 -0
- package/dist/Resources/Kits/HatchKit.d.ts +15 -0
- package/dist/Resources/Kits/HatchKit.js +12 -0
- package/dist/Resources/Kits/OutlineKit.d.ts +12 -0
- package/dist/Resources/Kits/OutlineKit.js +10 -0
- package/dist/Resources/Kits/PaperKit.d.ts +11 -0
- package/dist/Resources/Kits/PaperKit.js +11 -0
- package/dist/Resources/Kits/RisoKit.d.ts +16 -0
- package/dist/Resources/Kits/RisoKit.js +11 -0
- package/dist/Resources/Kits/SketchKit.d.ts +9 -0
- package/dist/Resources/Kits/SketchKit.js +11 -0
- package/dist/Resources/Themes/BaseTheme.d.ts +5 -0
- package/dist/Resources/Themes/BaseTheme.js +5 -0
- package/dist/Resources/Themes/BeachTheme.d.ts +6 -0
- package/dist/Resources/Themes/BeachTheme.js +31 -0
- package/dist/Resources/Themes/FlatAutumnTheme.d.ts +6 -0
- package/dist/Resources/Themes/FlatAutumnTheme.js +29 -0
- package/dist/Resources/Themes/FlatCoolTheme.d.ts +6 -0
- package/dist/Resources/Themes/FlatCoolTheme.js +29 -0
- package/dist/Resources/Themes/NightTheme.d.ts +6 -0
- package/dist/Resources/Themes/NightTheme.js +29 -0
- package/dist/Resources/Themes/WarmCafeTheme.d.ts +6 -0
- package/dist/Resources/Themes/WarmCafeTheme.js +29 -0
- package/dist/Services/AssetService.d.ts +12 -0
- package/dist/Services/AssetService.js +204 -0
- package/dist/Services/BackgroundService.d.ts +33 -0
- package/dist/Services/BackgroundService.js +136 -0
- package/dist/Services/BalanceCritiqueService.d.ts +13 -0
- package/dist/Services/BalanceCritiqueService.js +64 -0
- package/dist/Services/CameraService.d.ts +21 -0
- package/dist/Services/CameraService.js +121 -0
- package/dist/Services/CatalogService.d.ts +29 -0
- package/dist/Services/CatalogService.js +51 -0
- package/dist/Services/ContactCritiqueService.d.ts +19 -0
- package/dist/Services/ContactCritiqueService.js +101 -0
- package/dist/Services/ContextService.d.ts +21 -0
- package/dist/Services/ContextService.js +94 -0
- package/dist/Services/CoverageCritiqueService.d.ts +16 -0
- package/dist/Services/CoverageCritiqueService.js +84 -0
- package/dist/Services/CustomAssetService.d.ts +31 -0
- package/dist/Services/CustomAssetService.js +184 -0
- package/dist/Services/DependencyOrderService.d.ts +12 -0
- package/dist/Services/DependencyOrderService.js +73 -0
- package/dist/Services/DescriptionService.d.ts +9 -0
- package/dist/Services/DescriptionService.js +27 -0
- package/dist/Services/FramingCheckService.d.ts +15 -0
- package/dist/Services/FramingCheckService.js +93 -0
- package/dist/Services/GazeService.d.ts +6 -0
- package/dist/Services/GazeService.js +43 -0
- package/dist/Services/GroupService.d.ts +17 -0
- package/dist/Services/GroupService.js +152 -0
- package/dist/Services/KitService.d.ts +23 -0
- package/dist/Services/KitService.js +96 -0
- package/dist/Services/LightingService.d.ts +24 -0
- package/dist/Services/LightingService.js +119 -0
- package/dist/Services/MapBaseService.d.ts +24 -0
- package/dist/Services/MapBaseService.js +104 -0
- package/dist/Services/MapLabelService.d.ts +26 -0
- package/dist/Services/MapLabelService.js +185 -0
- package/dist/Services/MapLegService.d.ts +23 -0
- package/dist/Services/MapLegService.js +87 -0
- package/dist/Services/MapPanelService.d.ts +16 -0
- package/dist/Services/MapPanelService.js +89 -0
- package/dist/Services/MapPinService.d.ts +11 -0
- package/dist/Services/MapPinService.js +56 -0
- package/dist/Services/MapProjectionService.d.ts +14 -0
- package/dist/Services/MapProjectionService.js +70 -0
- package/dist/Services/MapRouteService.d.ts +17 -0
- package/dist/Services/MapRouteService.js +79 -0
- package/dist/Services/PieceService.d.ts +43 -0
- package/dist/Services/PieceService.js +154 -0
- package/dist/Services/PlacementService.d.ts +60 -0
- package/dist/Services/PlacementService.js +415 -0
- package/dist/Services/PlaneBackgroundService.d.ts +24 -0
- package/dist/Services/PlaneBackgroundService.js +170 -0
- package/dist/Services/PlaneBoxService.d.ts +27 -0
- package/dist/Services/PlaneBoxService.js +209 -0
- package/dist/Services/PlaneDepthService.d.ts +18 -0
- package/dist/Services/PlaneDepthService.js +146 -0
- package/dist/Services/PlaneLabelService.d.ts +13 -0
- package/dist/Services/PlaneLabelService.js +115 -0
- package/dist/Services/PlaneObjectService.d.ts +17 -0
- package/dist/Services/PlaneObjectService.js +147 -0
- package/dist/Services/PlanePathService.d.ts +15 -0
- package/dist/Services/PlanePathService.js +98 -0
- package/dist/Services/PlaneProjectionService.d.ts +16 -0
- package/dist/Services/PlaneProjectionService.js +90 -0
- package/dist/Services/PlaneRoadService.d.ts +13 -0
- package/dist/Services/PlaneRoadService.js +105 -0
- package/dist/Services/PlaneScatterService.d.ts +11 -0
- package/dist/Services/PlaneScatterService.js +48 -0
- package/dist/Services/PlaneSpaceService.d.ts +27 -0
- package/dist/Services/PlaneSpaceService.js +96 -0
- package/dist/Services/PlaneSpriteService.d.ts +29 -0
- package/dist/Services/PlaneSpriteService.js +95 -0
- package/dist/Services/PlaneTitleService.d.ts +17 -0
- package/dist/Services/PlaneTitleService.js +126 -0
- package/dist/Services/PlaneZoneService.d.ts +20 -0
- package/dist/Services/PlaneZoneService.js +121 -0
- package/dist/Services/RasterService.d.ts +10 -0
- package/dist/Services/RasterService.js +68 -0
- package/dist/Services/SchemaService.d.ts +3 -0
- package/dist/Services/SchemaService.js +10 -0
- package/dist/Services/SilhouetteCritiqueService.d.ts +32 -0
- package/dist/Services/SilhouetteCritiqueService.js +155 -0
- package/dist/Services/TextService.d.ts +47 -0
- package/dist/Services/TextService.js +178 -0
- package/dist/Services/ThemeService.d.ts +5 -0
- package/dist/Services/ThemeService.js +18 -0
- package/dist/Utils/BoxUtil.d.ts +4 -0
- package/dist/Utils/BoxUtil.js +8 -0
- package/dist/Utils/ColorUtil.d.ts +20 -0
- package/dist/Utils/ColorUtil.js +51 -0
- package/dist/Utils/CurveUtil.d.ts +6 -0
- package/dist/Utils/CurveUtil.js +35 -0
- package/dist/Utils/FallbackUtil.d.ts +3 -0
- package/dist/Utils/FallbackUtil.js +8 -0
- package/dist/Utils/FormatUtil.d.ts +4 -0
- package/dist/Utils/FormatUtil.js +9 -0
- package/dist/Utils/IdUtil.d.ts +4 -0
- package/dist/Utils/IdUtil.js +11 -0
- package/dist/Utils/NormalizeUtil.d.ts +4 -0
- package/dist/Utils/NormalizeUtil.js +9 -0
- package/dist/Utils/OklabUtil.d.ts +23 -0
- package/dist/Utils/OklabUtil.js +62 -0
- package/dist/Utils/PersonArmUtil.d.ts +19 -0
- package/dist/Utils/PersonArmUtil.js +84 -0
- package/dist/Utils/PersonHeadUtil.d.ts +31 -0
- package/dist/Utils/PersonHeadUtil.js +154 -0
- package/dist/Utils/PersonOutfitUtil.d.ts +48 -0
- package/dist/Utils/PersonOutfitUtil.js +178 -0
- package/dist/Utils/PersonUtil.d.ts +39 -0
- package/dist/Utils/PersonUtil.js +206 -0
- package/dist/Utils/PixelUtil.d.ts +3 -0
- package/dist/Utils/PixelUtil.js +8 -0
- package/dist/Utils/RecolorUtil.d.ts +40 -0
- package/dist/Utils/RecolorUtil.js +155 -0
- package/dist/Utils/RegistryUtil.d.ts +8 -0
- package/dist/Utils/RegistryUtil.js +19 -0
- package/dist/Utils/RequireUtil.d.ts +3 -0
- package/dist/Utils/RequireUtil.js +11 -0
- package/dist/Utils/SanitizeUtil.d.ts +25 -0
- package/dist/Utils/SanitizeUtil.js +210 -0
- package/dist/Utils/SeedUtil.d.ts +6 -0
- package/dist/Utils/SeedUtil.js +15 -0
- package/dist/Utils/ShapeUtil.d.ts +31 -0
- package/dist/Utils/ShapeUtil.js +47 -0
- package/dist/Utils/SuggestUtil.d.ts +7 -0
- package/dist/Utils/SuggestUtil.js +25 -0
- package/dist/Utils/SvgUtil.d.ts +9 -0
- package/dist/Utils/SvgUtil.js +21 -0
- package/dist/Utils/ThemeUtil.d.ts +4 -0
- package/dist/Utils/ThemeUtil.js +13 -0
- package/dist/Utils/TransportUtil.d.ts +24 -0
- package/dist/Utils/TransportUtil.js +108 -0
- package/dist/cli.js +24 -97
- package/dist/index.d.ts +10 -6
- package/dist/index.js +14 -2
- package/dist/render.d.ts +8 -5
- package/dist/render.js +21 -3
- package/dist/schema.d.ts +9 -2
- package/dist/schema.js +29 -5
- package/package.json +3 -2
- package/skills/{scenec → draw-scene}/SKILL.md +15 -19
- package/skills/{scenec → draw-scene}/references/catalog.md +14 -14
- package/skills/{scenec → draw-scene}/references/dsl.md +9 -3
- package/dist/catalog.d.ts +0 -21
- package/dist/catalog.js +0 -35
- package/dist/data/europe.json +0 -1
- package/dist/drawing/assets.d.ts +0 -8
- package/dist/drawing/assets.js +0 -612
- package/dist/drawing/kits.d.ts +0 -7
- package/dist/drawing/kits.js +0 -92
- package/dist/drawing/person.d.ts +0 -18
- package/dist/drawing/person.js +0 -287
- package/dist/drawing/themes.d.ts +0 -4
- package/dist/drawing/themes.js +0 -45
- package/dist/modes/map.d.ts +0 -5
- package/dist/modes/map.js +0 -365
- package/dist/modes/plane.d.ts +0 -5
- package/dist/modes/plane.js +0 -716
- package/dist/pipeline/compile.d.ts +0 -2
- package/dist/pipeline/compile.js +0 -581
- package/dist/pipeline/custom.d.ts +0 -2
- package/dist/pipeline/custom.js +0 -120
- package/dist/pipeline/groups.d.ts +0 -2
- package/dist/pipeline/groups.js +0 -189
- package/dist/pipeline/index.js +0 -7
- package/dist/pipeline/parse.d.ts +0 -10
- package/dist/pipeline/parse.js +0 -80
- package/dist/protocols/options.js +0 -1
- package/dist/protocols/scene.d.ts +0 -299
- package/dist/protocols/scene.js +0 -118
- package/dist/protocols/theme.js +0 -1
- package/dist/render/check.d.ts +0 -6
- package/dist/render/check.js +0 -10
- package/dist/render/critic.d.ts +0 -1
- package/dist/render/critic.js +0 -235
- package/dist/render/files.d.ts +0 -2
- package/dist/render/files.js +0 -16
- package/dist/render/fonts.d.ts +0 -2
- package/dist/render/fonts.js +0 -4
- package/dist/render/png.d.ts +0 -9
- package/dist/render/png.js +0 -13
- package/dist/utils/color.d.ts +0 -5
- package/dist/utils/color.js +0 -35
- package/dist/utils/recolor.d.ts +0 -1
- package/dist/utils/recolor.js +0 -56
- package/dist/utils/sanitize.d.ts +0 -5
- package/dist/utils/sanitize.js +0 -169
- package/dist/utils/suggest.d.ts +0 -1
- package/dist/utils/suggest.js +0 -22
- package/dist/utils/svg.d.ts +0 -2
- package/dist/utils/svg.js +0 -11
- package/skills/scenec/references/fontes.md +0 -8
- /package/dist/{protocols/options.d.ts → Protocols/OptionsProtocol.d.ts} +0 -0
- /package/skills/{scenec/recipes/anuncios-variacoes.yaml → draw-scene/recipes/ad-variations.yaml} +0 -0
- /package/skills/{scenec/recipes/carrossel.yaml → draw-scene/recipes/carousel.yaml} +0 -0
- /package/skills/{scenec/recipes/elearning.yaml → draw-scene/recipes/e-learning.yaml} +0 -0
- /package/skills/{scenec/recipes/reels-explicativo.yaml → draw-scene/recipes/explainer-reel.yaml} +0 -0
- /package/skills/{scenec/recipes/historia-ilustrada.yaml → draw-scene/recipes/illustrated-story.yaml} +0 -0
- /package/skills/{scenec/recipes/mapas-jornadas.yaml → draw-scene/recipes/journey-map.yaml} +0 -0
- /package/skills/{scenec/recipes/wrapped-personalizado.yaml → draw-scene/recipes/personalized-wrapped.yaml} +0 -0
- /package/skills/{scenec/recipes/ilustracoes-produto.yaml → draw-scene/recipes/product-illustration.yaml} +0 -0
package/dist/drawing/kits.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const KITS: Record<string, any>;
|
|
2
|
-
export declare function outlineFilter(id: any, r: any, ink: any): string;
|
|
3
|
-
export declare function dropFilter(id: any, s: any): string;
|
|
4
|
-
export declare function innerStroke(art: any, w: any, ink: any): string;
|
|
5
|
-
export declare function hatchDefs(ink: any): string;
|
|
6
|
-
export declare function sceneFilter(kind: any, t: any): string;
|
|
7
|
-
export declare function texture(kind: any, W: any, H: any): string;
|
package/dist/drawing/kits.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
// Kits de estilo: a mesma cena com outra linguagem visual (não só outra paleta).
|
|
2
|
-
// canvas.kit: flat (padrão) | outline | hatch | riso | paper | sketch
|
|
3
|
-
// Cada kit decide: cores de base, como a luz aparece (gradiente, hachura ou nada), contorno por objeto,
|
|
4
|
-
// filtro de cena inteira e textura por cima (abaixo do texto). Tudo SVG puro, renderizável no resvg.
|
|
5
|
-
export const KITS = {
|
|
6
|
-
flat: { desc: "vetor chapado com luz suave (padrão)" },
|
|
7
|
-
outline: {
|
|
8
|
-
desc: "contorno de desenho animado: borda grossa na silhueta e traço fino por dentro",
|
|
9
|
-
outline: { w: 2.6, inner: 0.9 }, light: { strength: 0.45 },
|
|
10
|
-
},
|
|
11
|
-
hatch: {
|
|
12
|
-
desc: "gravura/HQ: contorno a nanquim, sombras em hachura em vez de gradiente, papel claro",
|
|
13
|
-
outline: { w: 2.4, inner: 1.0 }, light: { mode: "hatch" }, texture: "paper",
|
|
14
|
-
colors: { shadow: "rgba(40,30,30,0.18)" },
|
|
15
|
-
},
|
|
16
|
-
riso: {
|
|
17
|
-
desc: "risografia: poucas tintas vivas, granulado de impressão e registro levemente desalinhado",
|
|
18
|
-
colors: { primary: "#0078BF", accent: "#FF48B0", secondary: "#1F3A93", paper: "#FFF8EC", text: "#1A1F4A", ink: "#1A1F4A" },
|
|
19
|
-
light: { mode: "none" }, scene: "riso",
|
|
20
|
-
},
|
|
21
|
-
paper: {
|
|
22
|
-
desc: "recorte de papel: cada peça com sombra própria e textura de fibra",
|
|
23
|
-
light: { strength: 0.18, casts: false }, drop: true, texture: "fiber",
|
|
24
|
-
},
|
|
25
|
-
sketch: {
|
|
26
|
-
desc: "esboço: cores lavadas como aquarela e linhas de lápis nas bordas",
|
|
27
|
-
light: { mode: "none" }, scene: "sketch", texture: "paper",
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
const n = (v) => (+v).toFixed(3);
|
|
31
|
-
// contorno de silhueta (dilata o alfa e pinta de tinta por baixo do objeto)
|
|
32
|
-
export function outlineFilter(id, r, ink) {
|
|
33
|
-
return `<filter id="${id}" x="-15%" y="-15%" width="130%" height="130%"><feMorphology in="SourceAlpha" operator="dilate" radius="${n(r)}" result="d"/>` +
|
|
34
|
-
`<feFlood flood-color="${ink}"/><feComposite in2="d" operator="in" result="o"/><feMerge><feMergeNode in="o"/><feMergeNode in="SourceGraphic"/></feMerge></filter>`;
|
|
35
|
-
}
|
|
36
|
-
// sombra de recorte de papel
|
|
37
|
-
export function dropFilter(id, s) {
|
|
38
|
-
return `<filter id="${id}" x="-20%" y="-20%" width="140%" height="150%"><feGaussianBlur in="SourceAlpha" stdDeviation="${n(2.2 / s)}"/>` +
|
|
39
|
-
`<feOffset dx="${n(2.5 / s)}" dy="${n(4 / s)}" result="b"/><feFlood flood-color="#2B1D10" flood-opacity="0.42"/><feComposite in2="b" operator="in" result="sh"/>` +
|
|
40
|
-
`<feMerge><feMergeNode in="sh"/><feMergeNode in="SourceGraphic"/></feMerge></filter>`;
|
|
41
|
-
}
|
|
42
|
-
// traço fino por dentro: formas sem stroke ganham contorno; brilhos e transparências ficam sem
|
|
43
|
-
export function innerStroke(art, w, ink) {
|
|
44
|
-
const a = art.replace(/<(rect|path|circle|ellipse|polygon)\b([^>]*?)\/>/g, (m, tag, attrs) => /\bopacity=|fill-opacity=|fill="none"|fill="url\(/.test(attrs) || /\bstroke=/.test(attrs) ? (/\bstroke=/.test(attrs) ? m : `<${tag}${attrs} stroke="none"/>`) : m);
|
|
45
|
-
return `<g stroke="${ink}" stroke-width="${n(w)}" stroke-linejoin="round">${a}</g>`;
|
|
46
|
-
}
|
|
47
|
-
// padrões de hachura (sombra própria e sombra projetada)
|
|
48
|
-
export function hatchDefs(ink) {
|
|
49
|
-
return `<pattern id="hatchP" width="7" height="7" patternUnits="userSpaceOnUse" patternTransform="rotate(45)"><rect x="0" y="0" width="1.5" height="7" fill="${ink}" fill-opacity="0.5"/></pattern>` +
|
|
50
|
-
`<pattern id="hatchC" width="6" height="6" patternUnits="userSpaceOnUse" patternTransform="rotate(-35)"><rect x="0" y="0" width="1.4" height="6" fill="${ink}" fill-opacity="0.42"/><rect x="0" y="0" width="6" height="1.2" fill="${ink}" fill-opacity="0.22"/></pattern>`;
|
|
51
|
-
}
|
|
52
|
-
// filtros de cena inteira
|
|
53
|
-
export function sceneFilter(kind, t) {
|
|
54
|
-
if (kind === "riso") {
|
|
55
|
-
// posteriza (tinta chapada) -> cópia deslocada em rosa multiplicada (registro) -> poros de papel claros
|
|
56
|
-
return `<filter id="kitScene" x="0" y="0" width="100%" height="100%" color-interpolation-filters="sRGB">` +
|
|
57
|
-
`<feComponentTransfer in="SourceGraphic" result="post"><feFuncR type="discrete" tableValues="0.1 0.35 0.6 0.85 1"/><feFuncG type="discrete" tableValues="0.1 0.35 0.6 0.85 1"/><feFuncB type="discrete" tableValues="0.12 0.38 0.62 0.86 1"/></feComponentTransfer>` +
|
|
58
|
-
`<feOffset in="post" dx="2.2" dy="1.4" result="off"/>` +
|
|
59
|
-
// cópia deslocada vira tinta rosa só onde há tinta (alfa = 1 - luminância): áreas claras não mudam
|
|
60
|
-
`<feColorMatrix in="off" type="matrix" values="0 0 0 0 1 0 0 0 0 0.36 0 0 0 0 0.66 -0.2 -0.4 -0.08 0.62 0" result="tint"/>` +
|
|
61
|
-
`<feBlend in="post" in2="tint" mode="multiply" result="reg"/>` +
|
|
62
|
-
`<feTurbulence type="fractalNoise" baseFrequency="0.85" numOctaves="1" seed="7" result="nz"/>` +
|
|
63
|
-
`<feColorMatrix in="nz" type="matrix" values="0 0 0 0 1 0 0 0 0 0.98 0 0 0 0 0.94 0 0 0 -2.4 1.25" result="spk"/>` +
|
|
64
|
-
`<feComposite in="spk" in2="reg" operator="in" result="spk2"/>` +
|
|
65
|
-
`<feMerge><feMergeNode in="reg"/><feMergeNode in="spk2"/></feMerge></filter>`;
|
|
66
|
-
}
|
|
67
|
-
if (kind === "sketch") {
|
|
68
|
-
// cores lavadas + bordas por convolução (laplaciano) desenhadas como grafite
|
|
69
|
-
return `<filter id="kitScene" x="0" y="0" width="100%" height="100%" color-interpolation-filters="sRGB">` +
|
|
70
|
-
`<feColorMatrix in="SourceGraphic" type="saturate" values="0.55" result="ds"/>` +
|
|
71
|
-
`<feComponentTransfer in="ds" result="wash"><feFuncR type="linear" slope="0.58" intercept="0.42"/><feFuncG type="linear" slope="0.58" intercept="0.42"/><feFuncB type="linear" slope="0.58" intercept="0.4"/></feComponentTransfer>` +
|
|
72
|
-
`<feColorMatrix in="SourceGraphic" type="matrix" values="0.3 0.59 0.11 0 0 0.3 0.59 0.11 0 0 0.3 0.59 0.11 0 0 0 0 0 1 0" result="g"/>` +
|
|
73
|
-
`<feConvolveMatrix in="g" order="3" kernelMatrix="-1 -1 -1 -1 8 -1 -1 -1 -1" preserveAlpha="true" result="e1"/>` +
|
|
74
|
-
`<feConvolveMatrix in="g" order="3" kernelMatrix="1 1 1 1 -8 1 1 1 1" preserveAlpha="true" result="e2"/>` +
|
|
75
|
-
`<feComposite in="e1" in2="e2" operator="arithmetic" k2="1" k3="1" result="e"/>` +
|
|
76
|
-
`<feColorMatrix in="e" type="matrix" values="0 0 0 0 0.22 0 0 0 0 0.22 0 0 0 0 0.26 2.2 2.2 2.2 0 0" result="lines"/>` +
|
|
77
|
-
`<feMorphology in="lines" operator="dilate" radius="0.6" result="lines2"/>` +
|
|
78
|
-
`<feMerge><feMergeNode in="wash"/><feMergeNode in="lines2"/></feMerge></filter>`;
|
|
79
|
-
}
|
|
80
|
-
return "";
|
|
81
|
-
}
|
|
82
|
-
// texturas por cima da cena (abaixo do texto)
|
|
83
|
-
export function texture(kind, W, H) {
|
|
84
|
-
if (kind === "paper")
|
|
85
|
-
return `<filter id="kitTex" x="0" y="0" width="100%" height="100%"><feTurbulence type="fractalNoise" baseFrequency="0.75" numOctaves="2" seed="3"/>` +
|
|
86
|
-
`<feColorMatrix type="matrix" values="0 0 0 0 0.45 0 0 0 0 0.4 0 0 0 0 0.33 0 0 0 -1.6 1.05"/></filter><rect width="${W}" height="${H}" filter="url(#kitTex)" opacity="0.05"/>`;
|
|
87
|
-
if (kind === "fiber")
|
|
88
|
-
return `<filter id="kitTex" x="0" y="0" width="100%" height="100%"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="2" seed="5" result="f"/>` +
|
|
89
|
-
`<feTurbulence type="fractalNoise" baseFrequency="0.02" numOctaves="3" seed="11" result="m"/><feComposite in="f" in2="m" operator="arithmetic" k2="0.6" k3="0.4" result="mix"/>` +
|
|
90
|
-
`<feColorMatrix in="mix" type="matrix" values="0 0 0 0 0.42 0 0 0 0 0.36 0 0 0 0 0.28 0.5 0 0 0 -0.12"/></filter><rect width="${W}" height="${H}" filter="url(#kitTex)" opacity="0.55"/>`;
|
|
91
|
-
return "";
|
|
92
|
-
}
|
package/dist/drawing/person.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export declare const EXPRESSION_NAMES: string[];
|
|
2
|
-
export declare const POSE_NAMES: {
|
|
3
|
-
standing: string[];
|
|
4
|
-
seated: string[];
|
|
5
|
-
};
|
|
6
|
-
export declare function bodyScale(p?: Record<string, any>): {
|
|
7
|
-
bx: number;
|
|
8
|
-
by: number;
|
|
9
|
-
hs: any;
|
|
10
|
-
};
|
|
11
|
-
export declare function person(p: any, t: any): {
|
|
12
|
-
svg: any;
|
|
13
|
-
hand: number[];
|
|
14
|
-
box: {
|
|
15
|
-
w: number;
|
|
16
|
-
h: number;
|
|
17
|
-
};
|
|
18
|
-
};
|
package/dist/drawing/person.js
DELETED
|
@@ -1,287 +0,0 @@
|
|
|
1
|
-
// Personagem riggado. Braços por cinemática inversa (2 ossos): cada pose define só onde
|
|
2
|
-
// ficam as mãos; o cotovelo é calculado. Unidades: pessoa em pé = 100, origem nos pés.
|
|
3
|
-
import { sh } from "../utils/color.js";
|
|
4
|
-
import { SKIN, HAIR } from "./themes.js";
|
|
5
|
-
const r = (n) => Math.round(n * 100) / 100;
|
|
6
|
-
const UPPER = 17, FORE = 16;
|
|
7
|
-
// Alvos das mãos (x>0 = lado direito da imagem) para vista frontal
|
|
8
|
-
const FRONT_POSES = {
|
|
9
|
-
standing: { L: [-15, -46], R: [15, -46] },
|
|
10
|
-
waving: { L: [-15, -46], R: [27, -105], openR: true },
|
|
11
|
-
pointing: { L: [-15, -46], R: [46, -77] },
|
|
12
|
-
presenting: { L: [-15, -46], R: [36, -66], openR: true, bendR: "down" },
|
|
13
|
-
celebrating: { L: [-24, -108], R: [24, -108], openL: true, openR: true },
|
|
14
|
-
holding: { L: [-15, -46], R: [21, -57] },
|
|
15
|
-
hands_on_hips: { L: [-12, -50], R: [12, -50] },
|
|
16
|
-
thinking: { L: [-7, -57], R: [5, -82], bendR: "down" },
|
|
17
|
-
shrugging: { L: [-27, -66], R: [27, -66], openL: true, openR: true },
|
|
18
|
-
walking: { L: [-8, -49], R: [19, -51] },
|
|
19
|
-
phone: { L: [-15, -46], R: [10, -88] },
|
|
20
|
-
};
|
|
21
|
-
export const EXPRESSION_NAMES = ["happy", "neutral", "surprised", "sad", "worried", "angry", "laughing", "wink", "thinking"];
|
|
22
|
-
// Vista lateral sentada (f = 1 olhando para a direita)
|
|
23
|
-
const SIDE_POSES = {
|
|
24
|
-
sitting: [20, -50], typing: [35, -55], reading: [22, -66], drinking: [10, -82],
|
|
25
|
-
};
|
|
26
|
-
export const POSE_NAMES = { standing: Object.keys(FRONT_POSES), seated: Object.keys(SIDE_POSES) };
|
|
27
|
-
// Proporções do corpo. age: child | teen | adult | elder; build: slim | average | broad | heavy;
|
|
28
|
-
// height: multiplicador da altura do corpo (0.85 a 1.15). A cabeça escala menos que o corpo (criança tem cabeça grande).
|
|
29
|
-
const AGE = { child: { bx: 0.8, by: 0.58, hs: 0.93 }, teen: { bx: 0.9, by: 0.86, hs: 0.97 }, adult: { bx: 1, by: 1, hs: 1 }, elder: { bx: 1, by: 0.95, hs: 1 } };
|
|
30
|
-
const BUILD = { slim: 0.88, average: 1, broad: 1.12, heavy: 1.16 };
|
|
31
|
-
export function bodyScale(p = {}) {
|
|
32
|
-
const a = AGE[p.age] || AGE.adult;
|
|
33
|
-
const hk = Math.max(0.8, Math.min(1.2, Number(p.height) || 1));
|
|
34
|
-
return { bx: a.bx * (BUILD[p.build] || 1), by: a.by * hk, hs: a.hs };
|
|
35
|
-
}
|
|
36
|
-
// Para onde os olhos olham: [gx, gy] em -1..1 (gy < 0 = para cima). Aceita palavras ou o vetor já resolvido pelo compilador.
|
|
37
|
-
const LOOK = { left: [-1, 0], right: [1, 0], up: [0, -1], down: [0, 1], "up-left": [-0.8, -0.7], "up-right": [0.8, -0.7], "down-left": [-0.8, 0.7], "down-right": [0.8, 0.7], camera: [0, 0], forward: [0, 0] };
|
|
38
|
-
const POSE_GAZE = { pointing: [1, -0.3], presenting: [0.8, 0], thinking: [-0.5, -0.8], celebrating: [0, -0.5], phone: [0.5, 0.4], holding: [0.5, 0.3],
|
|
39
|
-
reading: [0.5, 0.9], typing: [1, 0.15], drinking: [0.6, 0], sitting: [0.6, 0] };
|
|
40
|
-
function gazeOf(p, pose, f = 1) {
|
|
41
|
-
if (Array.isArray(p.gaze))
|
|
42
|
-
return p.gaze;
|
|
43
|
-
if (typeof p.look === "string" && LOOK[p.look])
|
|
44
|
-
return LOOK[p.look];
|
|
45
|
-
const g = POSE_GAZE[pose];
|
|
46
|
-
return g ? [g[0] * f, g[1]] : [0, 0];
|
|
47
|
-
}
|
|
48
|
-
function ik(S, T, side, bend = "out") {
|
|
49
|
-
let dx = T[0] - S[0], dy = T[1] - S[1];
|
|
50
|
-
let d = Math.hypot(dx, dy);
|
|
51
|
-
const max = UPPER + FORE - 0.01, min = Math.abs(UPPER - FORE) + 0.5;
|
|
52
|
-
if (d > max) {
|
|
53
|
-
dx *= max / d;
|
|
54
|
-
dy *= max / d;
|
|
55
|
-
d = max;
|
|
56
|
-
}
|
|
57
|
-
if (d < min)
|
|
58
|
-
d = min;
|
|
59
|
-
const a = Math.acos((UPPER ** 2 + d ** 2 - FORE ** 2) / (2 * UPPER * d));
|
|
60
|
-
const th = Math.atan2(dy, dx);
|
|
61
|
-
const e1 = [S[0] + UPPER * Math.cos(th + a), S[1] + UPPER * Math.sin(th + a)];
|
|
62
|
-
const e2 = [S[0] + UPPER * Math.cos(th - a), S[1] + UPPER * Math.sin(th - a)];
|
|
63
|
-
const pick = bend === "down" ? (e1[1] > e2[1] ? e1 : e2) : (side * e1[0] > side * e2[0] ? e1 : e2);
|
|
64
|
-
return { E: pick, H: [S[0] + dx, S[1] + dy] };
|
|
65
|
-
}
|
|
66
|
-
// Mão com forma: punho (palma + polegar) ou aberta (palma + dedos em leque + polegar), orientada pelo antebraço.
|
|
67
|
-
function hand(H, skin, open, side, E) {
|
|
68
|
-
const dx = E ? H[0] - E[0] : 0, dy = E ? H[1] - E[1] : 1;
|
|
69
|
-
const ang = (Math.atan2(dy, dx) * 180) / Math.PI;
|
|
70
|
-
// polegar do lado de cima/de dentro: escolhe a perpendicular que aponta para o centro do corpo
|
|
71
|
-
const n = [-dy, dx], toBody = [-H[0], -60 - H[1]];
|
|
72
|
-
const ts = n[0] * toBody[0] + n[1] * toBody[1] >= 0 ? 1 : -1;
|
|
73
|
-
const sk = sh(skin, -0.12);
|
|
74
|
-
const g = (inner) => `<g transform="translate(${r(H[0])} ${r(H[1])}) rotate(${r(ang)})">${inner}</g>`;
|
|
75
|
-
if (!open)
|
|
76
|
-
return g(`<ellipse cx="1.2" cy="${0.9 * ts}" rx="1.9" ry="1.3" fill="${sk}" transform="rotate(${-30 * ts} 1.2 ${0.9 * ts})"/>` +
|
|
77
|
-
`<rect x="-1.2" y="-3.1" width="6.4" height="6.2" rx="3" fill="${skin}"/>` +
|
|
78
|
-
`<ellipse cx="2.4" cy="${2.6 * ts}" rx="2.2" ry="1.25" fill="${skin}" transform="rotate(${-20 * ts} 2.4 ${2.6 * ts})"/>` +
|
|
79
|
-
`<path d="M4.2 -1.6 L4.2 1.6" stroke="${sk}" stroke-width="0.6" stroke-linecap="round"/>`);
|
|
80
|
-
const fingers = [-27, -9, 9, 27].map((a, i) => {
|
|
81
|
-
const len = [2.4, 3.1, 2.9, 2.1][i], rad = (a * Math.PI) / 180;
|
|
82
|
-
return `<path d="M3 ${r(Math.sin(rad) * 1.9)} L${r(3 + Math.cos(rad) * len)} ${r(Math.sin(rad) * (1.9 + len))}" stroke="${skin}" stroke-width="2.25" stroke-linecap="round"/>`;
|
|
83
|
-
}).join("");
|
|
84
|
-
return g(`<ellipse cx="1.3" cy="0" rx="3.7" ry="3.5" fill="${skin}"/>` + fingers +
|
|
85
|
-
`<path d="M0.6 ${2.2 * ts} L1.8 ${5 * ts}" stroke="${skin}" stroke-width="2.3" stroke-linecap="round"/>`);
|
|
86
|
-
}
|
|
87
|
-
function armPath(S, E, H, sleeve, skin, shortSleeve) {
|
|
88
|
-
const base = `fill="none" stroke-linecap="round" stroke-linejoin="round"`;
|
|
89
|
-
if (!shortSleeve)
|
|
90
|
-
return `<path d="M${r(S[0])} ${r(S[1])} L${r(E[0])} ${r(E[1])} L${r(H[0])} ${r(H[1])}" stroke="${sleeve}" ${base} stroke-width="7"/>`;
|
|
91
|
-
const mid = [S[0] + (E[0] - S[0]) * 0.6, S[1] + (E[1] - S[1]) * 0.6];
|
|
92
|
-
return `<path d="M${r(mid[0])} ${r(mid[1])} L${r(E[0])} ${r(E[1])} L${r(H[0])} ${r(H[1])}" stroke="${skin}" ${base} stroke-width="6"/>` +
|
|
93
|
-
`<path d="M${r(S[0])} ${r(S[1])} L${r(mid[0])} ${r(mid[1])}" stroke="${sleeve}" ${base} stroke-width="8"/>`;
|
|
94
|
-
}
|
|
95
|
-
function head(p, t, side, back, gz = [0, 0]) {
|
|
96
|
-
const skin = SKIN[p.skin] || SKIN.medium;
|
|
97
|
-
const hair = HAIR[p.hair_color] || p.hair_color || (p.age === "elder" ? HAIR.gray : HAIR.brown);
|
|
98
|
-
const cx = 0, cy = -91;
|
|
99
|
-
const style = p.hair || "short";
|
|
100
|
-
let backHair = "", front = "";
|
|
101
|
-
if (style === "long") {
|
|
102
|
-
backHair = `<path d="M-12 -93 Q-15 -70 -10 -68 L10 -68 Q15 -70 12 -93 Z" fill="${hair}"/>`;
|
|
103
|
-
front = `<path d="M-12 -92 Q-11 -105 0 -104 Q11 -105 12 -92 Q4 -99 -12 -92 Z" fill="${hair}"/>`;
|
|
104
|
-
}
|
|
105
|
-
else if (style === "bun") {
|
|
106
|
-
backHair = `<circle cx="0" cy="-105" r="6" fill="${hair}"/>`;
|
|
107
|
-
front = `<path d="M-11.5 -92 Q-11 -104 0 -103.5 Q11 -104 11.5 -92 Q2 -100 -11.5 -92 Z" fill="${hair}"/>`;
|
|
108
|
-
}
|
|
109
|
-
else if (style === "curly") {
|
|
110
|
-
front = [[-9, -6], [-4, -10], [2, -11], [8, -8], [11, -2], [-11, 0]].map(([dx, dy]) => `<circle cx="${cx + dx}" cy="${cy + dy}" r="5" fill="${hair}"/>`).join("");
|
|
111
|
-
}
|
|
112
|
-
else if (style === "ponytail") {
|
|
113
|
-
backHair = `<path d="M${-side * 9 - (side ? 0 : 9)} -96 Q${-side * 22 - (side ? 0 : 14)} -86 ${-side * 15 - (side ? 0 : 12)} -72" stroke="${hair}" stroke-width="6" fill="none" stroke-linecap="round"/>`;
|
|
114
|
-
front = `<path d="M-11.5 -92 Q-11 -104 0 -103.5 Q11 -104 11.5 -92 Q2 -100 -11.5 -92 Z" fill="${hair}"/>`;
|
|
115
|
-
}
|
|
116
|
-
else if (style === "short") {
|
|
117
|
-
front = `<path d="M-11 -93 Q-10 -104 1 -103 Q11 -102 11 -94 Q6 -98 -2 -97 Q-7 -96 -11 -93 Z" fill="${hair}"/>`;
|
|
118
|
-
}
|
|
119
|
-
else if (style === "bald") {
|
|
120
|
-
front = "";
|
|
121
|
-
}
|
|
122
|
-
const neck = `<rect x="-3" y="-85" width="6" height="7" fill="${sh(skin, -0.12)}"/>`;
|
|
123
|
-
if (back) {
|
|
124
|
-
// de costas: cabelo cobre a cabeça, sem rosto
|
|
125
|
-
const cover = style === "bald"
|
|
126
|
-
? `<circle cx="0" cy="${cy}" r="11" fill="${skin}"/>`
|
|
127
|
-
: `<circle cx="0" cy="${cy}" r="11" fill="${skin}"/><path d="M-11.3 -88 Q-12 -103 0 -103 Q12 -103 11.3 -88 Q0 -84 -11.3 -88 Z" fill="${hair}"/>` +
|
|
128
|
-
(style === "long" ? `<path d="M-11 -90 Q-13 -70 -9 -68 L9 -68 Q13 -70 11 -90 Z" fill="${hair}"/>` : "") + (style === "bun" ? `<circle cx="0" cy="-104" r="6" fill="${hair}"/>` : "");
|
|
129
|
-
return neck + backHair + cover;
|
|
130
|
-
}
|
|
131
|
-
const expr = p.expr || "happy";
|
|
132
|
-
// de frente, olhar para o lado também desloca o rosto (a cabeça "vira" um pouco)
|
|
133
|
-
const ex = side * 1.8 + (side ? 0 : gz[0] * 1.3);
|
|
134
|
-
const px = gz[0] * 1.1, py = gz[1] * 1.1;
|
|
135
|
-
const eye = (x) => `<circle cx="${r(x + px)}" cy="${r(cy + py)}" r="1.45" fill="${t.ink}"/><circle cx="${r(x + px + 0.45)}" cy="${r(cy + py - 0.5)}" r="0.42" fill="#FFFFFF" opacity="0.85"/>`;
|
|
136
|
-
const eyes = expr === "wink"
|
|
137
|
-
? eye(-4 + ex) + `<path d="M${r(2.4 + ex)} ${cy} Q${r(4 + ex)} ${cy - 1.6} ${r(5.6 + ex)} ${cy}" stroke="${t.ink}" stroke-width="1.1" fill="none" stroke-linecap="round"/>`
|
|
138
|
-
: eye(-4 + ex) + eye(4 + ex);
|
|
139
|
-
const mx = side * 2 + (side ? 0 : gz[0] * 1.3);
|
|
140
|
-
const mouth = expr === "surprised"
|
|
141
|
-
? `<ellipse cx="${mx}" cy="${cy + 5.5}" rx="1.6" ry="2" fill="${t.ink}"/>`
|
|
142
|
-
: expr === "neutral"
|
|
143
|
-
? `<path d="M${mx - 2.5} ${cy + 5.5} L${mx + 2.5} ${cy + 5.5}" stroke="${t.ink}" stroke-width="1.2" stroke-linecap="round"/>`
|
|
144
|
-
: expr === "sad" || expr === "worried" || expr === "angry"
|
|
145
|
-
? `<path d="M${mx - 3} ${cy + 6.5} Q${mx} ${cy + 3.8} ${mx + 3} ${cy + 6.5}" stroke="${t.ink}" stroke-width="1.2" fill="none" stroke-linecap="round"/>`
|
|
146
|
-
: expr === "laughing"
|
|
147
|
-
? `<path d="M${mx - 3.5} ${cy + 4} Q${mx} ${cy + 9.5} ${mx + 3.5} ${cy + 4} Z" fill="${t.ink}"/>`
|
|
148
|
-
: `<path d="M${mx - 3} ${cy + 4.5} Q${mx} ${cy + 7.5} ${mx + 3} ${cy + 4.5}" stroke="${t.ink}" stroke-width="1.2" fill="none" stroke-linecap="round"/>`;
|
|
149
|
-
const brows = expr === "thinking" || expr === "surprised"
|
|
150
|
-
? `<path d="M${-6 + ex} ${cy - 4.5} L${-2 + ex} ${cy - 5.2} M${2 + ex} ${cy - 5.2} L${6 + ex} ${cy - 4.5}" stroke="${hair}" stroke-width="1.1" stroke-linecap="round"/>`
|
|
151
|
-
: expr === "worried"
|
|
152
|
-
? `<path d="M${-6 + ex} ${cy - 4.2} L${-2 + ex} ${cy - 5.6} M${2 + ex} ${cy - 5.6} L${6 + ex} ${cy - 4.2}" stroke="${hair}" stroke-width="1.1" stroke-linecap="round"/>`
|
|
153
|
-
: expr === "angry" ? `<path d="M${-6 + ex} ${cy - 5.6} L${-2 + ex} ${cy - 4} M${2 + ex} ${cy - 4} L${6 + ex} ${cy - 5.6}" stroke="${hair}" stroke-width="1.3" stroke-linecap="round"/>` : "";
|
|
154
|
-
const blush = `<circle cx="${-6.5 + ex}" cy="${cy + 3.5}" r="2" fill="#E9806E" opacity="0.35"/><circle cx="${6.5 + ex}" cy="${cy + 3.5}" r="2" fill="#E9806E" opacity="0.35"/>`;
|
|
155
|
-
const glasses = p.glasses ? `<g stroke="${t.ink}" stroke-width="1" fill="none"><circle cx="${-4 + ex}" cy="${cy}" r="3.2"/><circle cx="${4 + ex}" cy="${cy}" r="3.2"/><path d="M${-0.8 + ex} ${cy} L${0.8 + ex} ${cy}"/></g>` : "";
|
|
156
|
-
const beard = p.beard ? `<path d="M-10 -89 Q-10 -76 0 -76 Q10 -76 10 -89 Q8 -83 ${mx + 4} ${cy + 3} L${mx - 4} ${cy + 3} Q-8 -83 -10 -89 Z" fill="${hair}"/>` : "";
|
|
157
|
-
const lines = p.age === "elder" ? `<path d="M${r(-8.2 + ex)} ${cy - 1.5} l-1.4 -0.6 M${r(8.2 + ex)} ${cy - 1.5} l1.4 -0.6 M${r(-5 + ex)} ${cy - 7.5} L${r(5 + ex)} ${cy - 7.5}" stroke="${sh(skin, -0.25)}" stroke-width="0.6" stroke-linecap="round"/>` : "";
|
|
158
|
-
const ear = side ? `<ellipse cx="${-side * 10}" cy="${cy + 1}" rx="2" ry="3" fill="${sh(skin, -0.08)}"/>` : "";
|
|
159
|
-
return neck + backHair + ear + `<circle cx="${cx}" cy="${cy}" r="11" fill="${skin}"/>` +
|
|
160
|
-
front + beard + lines + eyes + brows + mouth + blush + glasses;
|
|
161
|
-
}
|
|
162
|
-
export function person(p, t) {
|
|
163
|
-
const skin = SKIN[p.skin] || SKIN.medium;
|
|
164
|
-
const top = t[p.shirt] || p.shirt || t.primary;
|
|
165
|
-
const bottomC = t[p.pants] || p.pants || t.secondary;
|
|
166
|
-
const jacket = p.jacket ? (t[p.jacket] || p.jacket) : null;
|
|
167
|
-
const outfit = p.outfit || "tshirt"; // tshirt | sweater | dress
|
|
168
|
-
const bottom = outfit === "dress" ? "dress" : (p.bottom || "pants"); // pants | shorts | skirt
|
|
169
|
-
const shoes = t[p.shoes] || p.shoes || t.ink;
|
|
170
|
-
const pose = p.pose || "standing";
|
|
171
|
-
const gownC = outfit === "gown" ? (t[p.gown] || p.gown || t.ink) : null;
|
|
172
|
-
const sleeve = outfit === "labcoat" ? "#FBFBF8" : gownC || jacket || top;
|
|
173
|
-
const shortSleeve = !jacket && outfit === "tshirt";
|
|
174
|
-
const k = bodyScale(p);
|
|
175
|
-
const shadow = `<ellipse cx="0" cy="0" rx="${r(20 * k.bx)}" ry="3.2" fill="${t.shadow}"/>`;
|
|
176
|
-
const B = (x) => `<g transform="scale(${r(k.bx)} ${r(k.by)})">${x}</g>`;
|
|
177
|
-
const HD = (x, tilt = 0) => `<g transform="translate(0 ${r(-81 * k.by + 81 * k.hs)}) scale(${r(k.hs)}) rotate(${r(tilt)} 0 -82)">${x}</g>`;
|
|
178
|
-
const box = { w: 40 * k.bx, h: 81 * k.by + 27 * k.hs };
|
|
179
|
-
const out = (svg, H) => ({ svg, hand: [H[0] * k.bx, H[1] * k.by], box });
|
|
180
|
-
// ---------- sentado (perfil) ----------
|
|
181
|
-
if (SIDE_POSES[pose] || pose === "sitting_typing") {
|
|
182
|
-
const f = p.facing === "left" ? -1 : 1;
|
|
183
|
-
const T = SIDE_POSES[pose] || SIDE_POSES.typing;
|
|
184
|
-
const legColor = bottom === "pants" ? bottomC : skin;
|
|
185
|
-
let legs = `<path d="M0 -45 L${f * 24} -45 L${f * 24} -4" stroke="${legColor}" stroke-width="11" fill="none" stroke-linejoin="round"/>` +
|
|
186
|
-
`<path d="M${f * 2} -41 L${f * 24} -41" stroke="${sh(legColor, -0.12)}" stroke-width="3" fill="none"/>` +
|
|
187
|
-
`<path d="M${f * 21} -3 L${f * 32} -3 Q${f * 32} -8 ${f * 25} -8 L${f * 21} -8 Z" fill="${shoes}"/>`;
|
|
188
|
-
if (bottom === "shorts")
|
|
189
|
-
legs += `<path d="M0 -45 L${f * 14} -45" stroke="${bottomC}" stroke-width="12" stroke-linecap="butt"/>`;
|
|
190
|
-
if (bottom === "skirt" || bottom === "dress")
|
|
191
|
-
legs += `<path d="M${-f * 6} -52 L${f * 18} -50 L${f * 20} -39 L${-f * 7} -40 Z" fill="${bottom === "dress" ? top : bottomC}"/>`;
|
|
192
|
-
const torsoC = jacket || top;
|
|
193
|
-
const torso = `<rect x="-10" y="-81" width="20" height="40" rx="7" fill="${torsoC}"/>` +
|
|
194
|
-
`<path d="M${-f * 10} -74 Q${-f * 10} -81 ${-f * 4} -81 L${-f * 3} -81 L${-f * 3} -41 L${-f * 10} -41 Z" fill="${sh(torsoC, -0.13)}"/>` +
|
|
195
|
-
(jacket ? `<path d="M${f * 5} -80 L${f * 9} -76 L${f * 9} -44 L${f * 4} -44 Z" fill="${top}"/>` : "");
|
|
196
|
-
// braço de trás (mais escuro) + braço da frente
|
|
197
|
-
const S = [f * 2, -75];
|
|
198
|
-
const back = ik(S, [T[0] * f - f * 4, T[1] + 2], f, "down");
|
|
199
|
-
const front = ik(S, [T[0] * f, T[1]], f, "down");
|
|
200
|
-
const armsBack = armPath(S, back.E, back.H, sh(sleeve, -0.18), sh(skin, -0.15), shortSleeve) + hand(back.H, sh(skin, -0.15), false, f, back.E);
|
|
201
|
-
const armsFront = armPath(S, front.E, front.H, sleeve, skin, shortSleeve) + hand(front.H, skin, false, f, front.E);
|
|
202
|
-
const prop = pose === "reading"
|
|
203
|
-
? `<path d="M${r(front.H[0] - f * 2)} ${r(front.H[1] - 9)} L${r(front.H[0] + f * 8)} ${r(front.H[1] - 6)} L${r(front.H[0] + f * 8)} ${r(front.H[1] + 4)} L${r(front.H[0] - f * 2)} ${r(front.H[1] + 1)} Z" fill="${t.accent}"/>`
|
|
204
|
-
: pose === "drinking" ? `<path d="M${r(front.H[0] + f * 1)} ${r(front.H[1] - 7)} L${r(front.H[0] + f * 9)} ${r(front.H[1] - 7)} L${r(front.H[0] + f * 8)} ${r(front.H[1] + 3)} L${r(front.H[0] + f * 2)} ${r(front.H[1] + 3)} Z" fill="${t.paper}"/>` : "";
|
|
205
|
-
const gz = gazeOf(p, pose, f);
|
|
206
|
-
return out(shadow + B(armsBack + legs + torso) + HD(head(p, t, f, false, gz), f * gz[1] * 7) + B(armsFront + prop), front.H);
|
|
207
|
-
}
|
|
208
|
-
// ---------- em pé (frente ou costas) ----------
|
|
209
|
-
const back = p.view === "back";
|
|
210
|
-
const P = FRONT_POSES[pose] || FRONT_POSES.standing;
|
|
211
|
-
const side = p.facing === "left" ? -1 : p.facing === "right" ? 1 : 0;
|
|
212
|
-
const walk = pose === "walking";
|
|
213
|
-
let legs = "";
|
|
214
|
-
const legC = bottom === "pants" ? bottomC : skin;
|
|
215
|
-
if (walk) {
|
|
216
|
-
legs = `<path d="M-3 -45 L-12 -3" stroke="${legC}" stroke-width="8" stroke-linecap="round"/><path d="M3 -45 L11 -3" stroke="${sh(legC, -0.12)}" stroke-width="8" stroke-linecap="round"/>` +
|
|
217
|
-
`<ellipse cx="-14" cy="-2.5" rx="5.5" ry="2.8" fill="${shoes}"/><ellipse cx="14" cy="-2.5" rx="5.5" ry="2.8" fill="${shoes}"/>`;
|
|
218
|
-
}
|
|
219
|
-
else {
|
|
220
|
-
const lw = bottom === "pants" ? 8 : 6.5;
|
|
221
|
-
legs = `<rect x="${-1 - lw}" y="-47" width="${lw}" height="45" rx="3" fill="${legC}"/><rect x="1" y="-47" width="${lw}" height="45" rx="3" fill="${legC}"/>` +
|
|
222
|
-
`<rect x="${1 + lw * 0.45}" y="-47" width="${lw * 0.55}" height="45" rx="2" fill="${sh(legC, -0.12)}"/>` +
|
|
223
|
-
`<ellipse cx="-5.5" cy="-2.5" rx="5.5" ry="2.8" fill="${shoes}"/><ellipse cx="5.5" cy="-2.5" rx="5.5" ry="2.8" fill="${shoes}"/>`;
|
|
224
|
-
}
|
|
225
|
-
if (bottom === "shorts")
|
|
226
|
-
legs += `<path d="M-11 -47 L11 -47 L12 -30 L1 -30 L0 -36 L-1 -30 L-12 -30 Z" fill="${bottomC}"/><path d="M4 -47 L11 -47 L12 -30 L5 -30 Z" fill="${sh(bottomC, -0.12)}"/>`;
|
|
227
|
-
if (bottom === "skirt")
|
|
228
|
-
legs += `<path d="M-12 -48 L12 -48 L17 -27 L-17 -27 Z" fill="${bottomC}"/><path d="M4 -48 L12 -48 L17 -27 L7 -27 Z" fill="${sh(bottomC, -0.12)}"/>`;
|
|
229
|
-
if (bottom === "dress")
|
|
230
|
-
legs += `<path d="M-12 -48 L12 -48 L18 -24 L-18 -24 Z" fill="${top}"/><path d="M4 -48 L12 -48 L18 -24 L7 -24 Z" fill="${sh(top, -0.12)}"/>`;
|
|
231
|
-
const torsoC = jacket || top;
|
|
232
|
-
const heavy = p.build === "heavy";
|
|
233
|
-
let torso = heavy
|
|
234
|
-
? `<path d="M-13 -74 Q-13 -81 -6 -81 L6 -81 Q13 -81 13 -74 Q18 -58 13 -44 L-13 -44 Q-18 -58 -13 -74 Z" fill="${torsoC}"/>` +
|
|
235
|
-
`<path d="M5 -81 L6 -81 Q13 -81 13 -74 Q18 -58 13 -44 L5 -44 Z" fill="${sh(torsoC, -0.13)}"/>`
|
|
236
|
-
: `<path d="M-13 -74 Q-13 -81 -6 -81 L6 -81 Q13 -81 13 -74 L12 -44 L-12 -44 Z" fill="${torsoC}"/>` +
|
|
237
|
-
`<path d="M5 -81 L6 -81 Q13 -81 13 -74 L12 -44 L5 -44 Z" fill="${sh(torsoC, -0.13)}"/>`;
|
|
238
|
-
if (jacket && !back)
|
|
239
|
-
torso += `<path d="M-5 -81 L5 -81 L3 -45 L-3 -45 Z" fill="${top}"/><path d="M-5 -81 L-1 -70 L-4 -60 M5 -81 L1 -70 L4 -60" stroke="${sh(jacket, -0.25)}" stroke-width="1.2" fill="none"/>`;
|
|
240
|
-
if (!jacket && outfit === "sweater" && !back)
|
|
241
|
-
torso += `<path d="M-6 -81 Q0 -76 6 -81" stroke="${sh(top, -0.25)}" stroke-width="1.5" fill="none"/>`;
|
|
242
|
-
if (outfit === "tshirt" && !jacket && !back)
|
|
243
|
-
torso += `<path d="M-5 -81 Q0 -77 5 -81" fill="${sh(skin, -0.12)}"/>`;
|
|
244
|
-
// beca (gown) e jaleco (labcoat) por cima de tudo
|
|
245
|
-
if (gownC) {
|
|
246
|
-
torso += `<path d="M-13 -76 Q-13 -81 -6 -81 L6 -81 Q13 -81 13 -76 L18 -14 L-18 -14 Z" fill="${gownC}"/><path d="M5 -81 L6 -81 Q13 -81 13 -76 L18 -14 L6 -14 Z" fill="${sh(gownC, -0.15)}"/>` +
|
|
247
|
-
(back ? "" : `<path d="M-6 -81 L-3 -81 L-4 -46 L-7 -46 Z M3 -81 L6 -81 L7 -46 L4 -46 Z" fill="${t[p.stole] || t.accent}"/><path d="M-5 -81 Q0 -74 5 -81" fill="${sh(skin, -0.12)}"/>`);
|
|
248
|
-
}
|
|
249
|
-
if (outfit === "labcoat") {
|
|
250
|
-
const lc = "#FBFBF8";
|
|
251
|
-
torso += `<path d="M-13 -76 Q-13 -81 -6 -81 L6 -81 Q13 -81 13 -76 L15 -27 L-15 -27 Z" fill="${lc}"/><path d="M5 -81 L6 -81 Q13 -81 13 -76 L15 -27 L5 -27 Z" fill="${sh(lc, -0.1)}"/>` +
|
|
252
|
-
(back
|
|
253
|
-
? ""
|
|
254
|
-
: `<path d="M-5 -81 L5 -81 L1 -60 L-1 -60 Z" fill="${top}"/><path d="M0 -60 L0 -27" stroke="${sh(lc, -0.25)}" stroke-width="1"/>` +
|
|
255
|
-
`<rect x="-11" y="-42" width="7" height="6" rx="1" fill="none" stroke="${sh(lc, -0.25)}" stroke-width="1"/><path d="M6 -72 L6 -66" stroke="${t.primary}" stroke-width="1.6"/>`);
|
|
256
|
-
}
|
|
257
|
-
let pack = "";
|
|
258
|
-
if (p.backpack) {
|
|
259
|
-
const bc = t[p.backpack] || (p.backpack === true ? t.accent : p.backpack);
|
|
260
|
-
pack = back ? "" : `<rect x="-16" y="-79" width="32" height="32" rx="7" fill="${sh(bc, -0.2)}"/>`;
|
|
261
|
-
if (back)
|
|
262
|
-
torso += `<rect x="-11" y="-78" width="22" height="30" rx="7" fill="${bc}"/><rect x="-7" y="-62" width="14" height="10" rx="3" fill="${sh(bc, -0.15)}"/>`;
|
|
263
|
-
else
|
|
264
|
-
torso += `<path d="M-8 -81 L-9 -50 M8 -81 L9 -50" stroke="${sh(bc, -0.1)}" stroke-width="2.5" stroke-linecap="round"/>`;
|
|
265
|
-
}
|
|
266
|
-
const hat = p.hat === "grad_cap"
|
|
267
|
-
? `<path d="M-9 -103 L9 -103 L9 -98 Q0 -95 -9 -98 Z" fill="${t.ink}"/><path d="M-18 -103 L0 -110 L18 -103 L0 -96 Z" fill="${t.ink}"/><path d="M-18 -103 L0 -96 L18 -103 L0 -98.5 Z" fill="${sh(t.ink, 0.15)}"/>` +
|
|
268
|
-
`<path d="M0 -103 L13 -102 L14 -93" stroke="${t.accent}" stroke-width="1.3" fill="none"/><circle cx="14" cy="-92" r="1.8" fill="${t.accent}"/>`
|
|
269
|
-
: p.hat === "cap" ? `<path d="M-11 -97 Q-11 -108 0 -108 Q11 -108 11 -97 Z" fill="${t[p.hat_color] || t.primary}"/><path d="M${side >= 0 ? 4 : -18} -98 L${side >= 0 ? 18 : -4} -98 L${side >= 0 ? 16 : -6} -95 L${side >= 0 ? 4 : -4} -95 Z" fill="${sh(t[p.hat_color] || t.primary, -0.2)}"/>` : "";
|
|
270
|
-
const SL = [-12, -76], SR = [12, -76];
|
|
271
|
-
const L = ik(SL, P.L, -1, P.bendL), R = ik(SR, P.R, 1, P.bendR);
|
|
272
|
-
const arms = armPath(SL, L.E, L.H, sleeve, skin, shortSleeve) + hand(L.H, skin, P.openL, -1, L.E) +
|
|
273
|
-
armPath(SR, R.E, R.H, sleeve, skin, shortSleeve) + hand(R.H, skin, P.openR, 1, R.E);
|
|
274
|
-
// braço que cruza o corpo (pensando) vai na frente; demais também na frente do tronco
|
|
275
|
-
const gz = gazeOf(p, pose, side || 1);
|
|
276
|
-
const tilt = side ? side * gz[1] * 6 : gz[0] * 4;
|
|
277
|
-
// bengala (idoso): apoiada na mão esquerda quando ela está em repouso
|
|
278
|
-
const cane = p.cane && Math.abs(P.L[1] + 46) < 6
|
|
279
|
-
? `<path d="M${r(L.H[0] - 1)} ${r(L.H[1] + 2)} L${r(L.H[0] - 4)} -1" stroke="${t.trunk || "#6B4A33"}" stroke-width="2.4" stroke-linecap="round"/>` +
|
|
280
|
-
`<path d="M${r(L.H[0] - 1)} ${r(L.H[1] + 2)} Q${r(L.H[0] + 1)} ${r(L.H[1] - 4)} ${r(L.H[0] + 5)} ${r(L.H[1] - 1)}" stroke="${t.trunk || "#6B4A33"}" stroke-width="2.4" fill="none" stroke-linecap="round"/>`
|
|
281
|
-
: "";
|
|
282
|
-
const phone = pose === "phone" && !back ? `<rect x="${r(R.H[0] - 1.5)}" y="${r(R.H[1] - 8)}" width="4.6" height="8.5" rx="1.2" fill="${t.ink}"/><rect x="${r(R.H[0] - 0.8)}" y="${r(R.H[1] - 7.2)}" width="3.2" height="6.4" rx="0.6" fill="${t.glass || "#BFD7EA"}"/>` : "";
|
|
283
|
-
const svg = back
|
|
284
|
-
? B(legs + torso + arms) + HD(head(p, t, 0, true) + hat)
|
|
285
|
-
: B(legs + pack + torso) + HD(head(p, t, side, false, gz) + hat, tilt) + B(cane + arms + phone);
|
|
286
|
-
return out(shadow + svg, R.H);
|
|
287
|
-
}
|
package/dist/drawing/themes.d.ts
DELETED
package/dist/drawing/themes.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
// Temas: paletas aplicadas a todos os assets via "slots" de cor.
|
|
2
|
-
export const THEMES = {
|
|
3
|
-
"flat-autumn": {
|
|
4
|
-
skyTop: "#F6E7CF", skyBottom: "#FBEFDD", ground: "#C98B4E", groundDark: "#A86F3A",
|
|
5
|
-
wall: "#F3E3CC", floor: "#D9A86C",
|
|
6
|
-
primary: "#D9643A", secondary: "#3E6E6A", accent: "#F2B134",
|
|
7
|
-
foliage: ["#C8552E", "#E08A2E", "#B8442A"], trunk: "#6B3F26", wood: "#9A5B34", woodDark: "#7A4426",
|
|
8
|
-
ink: "#3A2418", paper: "#FFF8EE", glass: "#BFD9D6", metal: "#7D6B60",
|
|
9
|
-
text: "#3A2418", textOnDark: "#FFF8EE", shadow: "rgba(58,36,24,0.14)",
|
|
10
|
-
},
|
|
11
|
-
"flat-cool": {
|
|
12
|
-
skyTop: "#DCEBF7", skyBottom: "#EEF5FB", ground: "#8CC08A", groundDark: "#6FA56E",
|
|
13
|
-
wall: "#E9EEF4", floor: "#B8C4D1",
|
|
14
|
-
primary: "#3A6FD8", secondary: "#25344F", accent: "#F5A524",
|
|
15
|
-
foliage: ["#4E9E5C", "#6BB36A", "#3D8550"], trunk: "#6E5444", wood: "#B98A5E", woodDark: "#8E6542",
|
|
16
|
-
ink: "#1F2A3D", paper: "#FFFFFF", glass: "#BCD7F2", metal: "#8592A6",
|
|
17
|
-
text: "#1F2A3D", textOnDark: "#FFFFFF", shadow: "rgba(31,42,61,0.13)",
|
|
18
|
-
},
|
|
19
|
-
"night": {
|
|
20
|
-
skyTop: "#141B3A", skyBottom: "#2E3A6E", ground: "#1E2647", groundDark: "#161D38",
|
|
21
|
-
wall: "#2A3360", floor: "#1E2647",
|
|
22
|
-
primary: "#F2C14E", secondary: "#7A86C2", accent: "#FF7A59",
|
|
23
|
-
foliage: ["#2F5A5E", "#38686B", "#26494D"], trunk: "#3A2E3E", wood: "#5A4A63", woodDark: "#43374B",
|
|
24
|
-
ink: "#0E1330", paper: "#F5F1E6", glass: "#FFD97A", metal: "#59618F",
|
|
25
|
-
text: "#F5F1E6", textOnDark: "#F5F1E6", shadow: "rgba(0,0,0,0.25)",
|
|
26
|
-
},
|
|
27
|
-
"warm-cafe": {
|
|
28
|
-
skyTop: "#F4E1D2", skyBottom: "#F4E1D2", ground: "#8C5A3C", groundDark: "#6E452E",
|
|
29
|
-
wall: "#EAD2BE", floor: "#9C6844",
|
|
30
|
-
primary: "#B5482E", secondary: "#2F4A3E", accent: "#E8A93B",
|
|
31
|
-
foliage: ["#4F7A4A", "#628F57", "#3F6640"], trunk: "#5A3B28", wood: "#7A4A2E", woodDark: "#5C3620",
|
|
32
|
-
ink: "#2B1A12", paper: "#FFF6EC", glass: "#F6E2B8", metal: "#3A2B24",
|
|
33
|
-
text: "#2B1A12", textOnDark: "#FFF6EC", shadow: "rgba(43,26,18,0.16)",
|
|
34
|
-
},
|
|
35
|
-
"beach": {
|
|
36
|
-
skyTop: "#7FD0E8", skyBottom: "#D6F1F7", ground: "#F1D49B", groundDark: "#E2BF7E",
|
|
37
|
-
wall: "#FFF", floor: "#F1D49B", sea: "#2FA5C4", seaLight: "#5BC2DA",
|
|
38
|
-
primary: "#F0644B", secondary: "#126E86", accent: "#FFC845",
|
|
39
|
-
foliage: ["#2E9E6B", "#3DB37A", "#24855A"], trunk: "#9A6A3F", wood: "#B07A48", woodDark: "#8A5A32",
|
|
40
|
-
ink: "#0F3A47", paper: "#FFFFFF", glass: "#CFEFF7", metal: "#6D8790",
|
|
41
|
-
text: "#0F3A47", textOnDark: "#FFFFFF", shadow: "rgba(15,58,71,0.15)",
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
export const SKIN = { light: "#F2C9A5", medium: "#D19A6E", tan: "#B87A50", dark: "#7A4B30", deep: "#5A3522" };
|
|
45
|
-
export const HAIR = { black: "#1E1A1A", brown: "#5A3825", blonde: "#E2B45A", red: "#B0462A", gray: "#9C9C9C" };
|