├── .github └── workflows │ ├── build.yml │ └── linux_build.yml ├── .gitignore ├── .swift-version ├── .swiftformat ├── CHANGELOG.md ├── CONTRIBUTING.md ├── Euclid ├── .gitignore ├── .swift-version ├── .swiftformat ├── CHANGELOG.md ├── CONTRIBUTING.md ├── Euclid.docc │ ├── ConstructingMeshes.md │ ├── Euclid.md │ ├── Extensions │ │ ├── Angle.md │ │ ├── Bounds.md │ │ ├── Color.md │ │ ├── Line.md │ │ ├── LineSegment.md │ │ ├── Mesh.md │ │ ├── Path.md │ │ ├── PathPoint.md │ │ ├── Plane.md │ │ ├── Polygon.md │ │ ├── Quaternion.md │ │ ├── Rotation.md │ │ ├── Transform.md │ │ ├── Vector.md │ │ └── Vertex.md │ └── RenderingMeshes.md ├── Euclid.png ├── Euclid.podspec.json ├── Euclid.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ ├── Euclid.xcscheme │ │ └── Example.xcscheme ├── Example │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── EuclidMesh.swift │ ├── Info.plist │ ├── RealityKitViewController.swift │ └── SceneKitViewController.swift ├── LICENSE.md ├── Package.swift ├── Package@swift-5.5.swift ├── README.md ├── Sources │ ├── Angle.swift │ ├── BSP.swift │ ├── Bounded.swift │ ├── Bounds.swift │ ├── Color.swift │ ├── Euclid+AppKit.swift │ ├── Euclid+CoreGraphics.swift │ ├── Euclid+CoreText.swift │ ├── Euclid+RealityKit.swift │ ├── Euclid+SIMD.swift │ ├── Euclid+SceneKit.swift │ ├── Euclid+UIKit.swift │ ├── Euclid.h │ ├── Info.plist │ ├── Line.swift │ ├── LineSegment+CSG.swift │ ├── LineSegment.swift │ ├── Mesh+CSG.swift │ ├── Mesh+IO.swift │ ├── Mesh+OBJ.swift │ ├── Mesh+STL.swift │ ├── Mesh+Shapes.swift │ ├── Mesh+Texcoords.swift │ ├── Mesh.swift │ ├── Path+Shapes.swift │ ├── Path.swift │ ├── PathPoint.swift │ ├── Plane.swift │ ├── Polygon+CSG.swift │ ├── Polygon.swift │ ├── Quaternion.swift │ ├── Rotation.swift │ ├── Stretchable.swift │ ├── Transforms.swift │ ├── Utilities.swift │ ├── Vector.swift │ └── Vertex.swift └── Tests │ ├── AngleTests.swift │ ├── BoundsTests.swift │ ├── CGPathTests.swift │ ├── CodingTests.swift │ ├── Cube.stl │ ├── Euclid+Testing.swift │ ├── Info.plist │ ├── LineSegmentTests.swift │ ├── LineTests.swift │ ├── MeshCSGTests.swift │ ├── MeshExportTests.swift │ ├── MeshImportTests.swift │ ├── MeshShapeTests.swift │ ├── MeshTests.swift │ ├── MetadataTests.swift │ ├── PathShapeTests.swift │ ├── PathTests.swift │ ├── PlaneTests.swift │ ├── PolygonCSGTests.swift │ ├── PolygonTests.swift │ ├── QuaternionTests.swift │ ├── RealityKitTests.swift │ ├── SceneKitTests.swift │ ├── StretchableTests.swift │ ├── TextTests.swift │ ├── TransformTests.swift │ ├── UtilityTests.swift │ └── VectorTests.swift ├── Examples ├── Ball.shape ├── Chessboard.shape ├── Cog.shape ├── Earth.png ├── Earth.shape ├── Icosahedron.shape ├── Spirals.shape ├── Spring.shape ├── Stars.jpg └── Train.shape ├── LICENSE.md ├── LRUCache ├── .swift-version ├── .swiftformat ├── CHANGELOG.md ├── LICENSE.md ├── LRUCache.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ ├── xcbaselines │ │ └── 016FAB3121BFE78100AF60DC.xcbaseline │ │ │ ├── 161D8158-BED0-47AA-B7B7-479E4BF8141F.plist │ │ │ ├── E747DDD0-AA84-4045-B195-EA52F7309ADE.plist │ │ │ └── Info.plist │ │ └── xcschemes │ │ └── LRUCache.xcscheme ├── Package.swift ├── README.md ├── Sources │ ├── Info.plist │ └── LRUCache.swift └── Tests │ ├── Info.plist │ ├── LRUCacheTests.swift │ ├── LRUPerformanceTests.swift │ └── MetadataTests.swift ├── Package.swift ├── README.md ├── SVGPath ├── .gitignore ├── .swift-version ├── .swiftformat ├── CHANGELOG.md ├── LICENSE.md ├── Package.swift ├── README.md ├── SVGPath.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ ├── xcbaselines │ │ └── 016FAB3121BFE78100AF60DC.xcbaseline │ │ │ ├── 161D8158-BED0-47AA-B7B7-479E4BF8141F.plist │ │ │ ├── E747DDD0-AA84-4045-B195-EA52F7309ADE.plist │ │ │ └── Info.plist │ │ └── xcschemes │ │ └── SVGPath.xcscheme ├── Sources │ ├── Info.plist │ ├── SVGPath+CoreGraphics.swift │ └── SVGPath.swift └── Tests │ ├── CGPathTests.swift │ ├── Info.plist │ ├── MetadataTests.swift │ └── SVGPathTests.swift ├── ShapeScript.podspec.json ├── ShapeScript.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcshareddata │ └── xcschemes │ ├── CLI.xcscheme │ ├── ShapeScript Lib.xcscheme │ ├── Viewer (Mac).xcscheme │ └── Viewer (iOS).xcscheme ├── ShapeScript ├── Euclid+Extensions.swift ├── Euclid+SVGPath.swift ├── EvaluationContext.swift ├── EvaluationDelegate.swift ├── Geometry.swift ├── GeometryCache.swift ├── GeometryType.swift ├── Info.plist ├── Interpreter.swift ├── Lexer.swift ├── Material+Brightness.swift ├── Material+SceneKit.swift ├── Material.swift ├── Members.swift ├── Parser.swift ├── ProgramError.swift ├── RandomSequence.swift ├── Scene+SceneKit.swift ├── Scene.swift ├── StandardLibrary.swift ├── String+Matching.swift ├── String+Ordinals.swift ├── Symbols.swift ├── Types.swift ├── Value+JSON.swift ├── Value+Logging.swift └── Values.swift ├── ShapeScriptTests ├── EdgeOfTheGalaxyRegular-OVEa6.otf ├── GeometryTests.swift ├── ImportExportTests.swift ├── Info.plist ├── InterpreterTests.swift ├── LexerTests.swift ├── LoggingTests.swift ├── MemberTests.swift ├── MetadataTests.swift ├── ParserTests.swift ├── PlatformTests.swift ├── RegressionTests.swift ├── SVGPathTests.swift ├── StandardLibraryTests.swift ├── Stars1.jpg ├── StringMatchingTests.swift ├── TestDelegate.swift ├── TestShapes │ ├── CracksTest-mac.shape │ ├── CracksTest2.shape │ ├── CracksTest3.shape │ ├── CracksTest4.shape │ ├── CrashTest.shape │ ├── Extrusions.shape │ └── Lofts.shape └── TypesystemTests.swift ├── Viewer ├── CLI │ ├── CLI+Export.swift │ ├── CLI.swift │ ├── Geometry+ModelInfo.swift │ ├── ProgramError+Formatting.swift │ └── main.swift ├── Mac │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── 1024-dark.png │ │ │ ├── 128-dark.png │ │ │ ├── 16-dark.png │ │ │ ├── 256-dark.png │ │ │ ├── 32-dark.png │ │ │ ├── 512-dark.png │ │ │ ├── 64-dark.png │ │ │ └── Contents.json │ │ └── Contents.json │ ├── Base.lproj │ │ └── Main.storyboard │ ├── Document.swift │ ├── DocumentViewController.swift │ ├── Info.plist │ ├── LicensesViewController.swift │ ├── PreferencesViewController.swift │ ├── Settings+Editor.swift │ ├── Utilities.swift │ ├── Viewer.entitlements │ ├── Welcome.rtf │ ├── WelcomeViewController.swift │ ├── WhatsNew.rtf │ ├── WhatsNewViewController.swift │ └── WindowController.swift ├── Shared │ ├── Axes.swift │ ├── Camera.swift │ ├── Document+EvaluationDelegate.swift │ ├── Document+ModelInfo.swift │ ├── Document+Sandbox.swift │ ├── Document+View.swift │ ├── DocumentViewController+View.swift │ ├── FileMonitor.swift │ ├── Licenses.rtf │ ├── LoadingProgress.swift │ ├── ProgramError+Formatting.swift │ ├── Settings.swift │ └── Untitled.shape └── iOS │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ ├── 1024.png │ │ ├── 120-1.png │ │ ├── 120.png │ │ ├── 152.png │ │ ├── 167.png │ │ ├── 180.png │ │ ├── 20.png │ │ ├── 29.png │ │ ├── 40-1.png │ │ ├── 40-2.png │ │ ├── 40.png │ │ ├── 58-1.png │ │ ├── 58.png │ │ ├── 60.png │ │ ├── 76.png │ │ ├── 80-1.png │ │ ├── 80.png │ │ ├── 87.png │ │ └── Contents.json │ ├── AppIcon.solidimagestack │ │ ├── Back.solidimagestacklayer │ │ │ ├── Content.imageset │ │ │ │ ├── Back.png │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── Front.solidimagestacklayer │ │ │ ├── Content.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── Front.png │ │ │ └── Contents.json │ │ └── Middle.solidimagestacklayer │ │ │ ├── Content.imageset │ │ │ └── Contents.json │ │ │ └── Contents.json │ └── Contents.json │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Document.swift │ ├── DocumentBrowserViewController.swift │ ├── DocumentViewController.swift │ ├── Info.plist │ ├── LicensesViewController.swift │ ├── SceneDelegate.swift │ ├── SourceViewController.swift │ ├── SplitView.swift │ ├── TextView.swift │ ├── TokenView.swift │ ├── WhatsNew.rtf │ └── WhatsNewViewController.swift ├── docs ├── 1.5.10 │ ├── ios │ │ ├── blocks.md │ │ ├── bounds.md │ │ ├── builders.md │ │ ├── camera-control.md │ │ ├── cameras.md │ │ ├── commands.md │ │ ├── comments.md │ │ ├── control-flow.md │ │ ├── csg.md │ │ ├── debugging.md │ │ ├── examples.md │ │ ├── export.md │ │ ├── expressions.md │ │ ├── functions.md │ │ ├── getting-started.md │ │ ├── glossary.md │ │ ├── groups.md │ │ ├── import.md │ │ ├── index.md │ │ ├── lights.md │ │ ├── literals.md │ │ ├── materials.md │ │ ├── options.md │ │ ├── paths.md │ │ ├── primitives.md │ │ ├── scope.md │ │ ├── symbols.md │ │ ├── text.md │ │ └── transforms.md │ └── mac │ │ ├── blocks.md │ │ ├── bounds.md │ │ ├── builders.md │ │ ├── camera-control.md │ │ ├── cameras.md │ │ ├── commands.md │ │ ├── comments.md │ │ ├── control-flow.md │ │ ├── csg.md │ │ ├── debugging.md │ │ ├── examples.md │ │ ├── export.md │ │ ├── expressions.md │ │ ├── functions.md │ │ ├── getting-started.md │ │ ├── glossary.md │ │ ├── groups.md │ │ ├── import.md │ │ ├── index.md │ │ ├── lights.md │ │ ├── literals.md │ │ ├── materials.md │ │ ├── options.md │ │ ├── paths.md │ │ ├── primitives.md │ │ ├── scope.md │ │ ├── symbols.md │ │ ├── text.md │ │ └── transforms.md ├── 1.5.11 ├── 1.5.12 ├── 1.5.13 ├── 1.5.14 │ ├── ios │ │ ├── blocks.md │ │ ├── bounds.md │ │ ├── builders.md │ │ ├── camera-control.md │ │ ├── cameras.md │ │ ├── commands.md │ │ ├── comments.md │ │ ├── control-flow.md │ │ ├── csg.md │ │ ├── debugging.md │ │ ├── examples.md │ │ ├── export.md │ │ ├── expressions.md │ │ ├── functions.md │ │ ├── getting-started.md │ │ ├── glossary.md │ │ ├── groups.md │ │ ├── import.md │ │ ├── index.md │ │ ├── lights.md │ │ ├── literals.md │ │ ├── materials.md │ │ ├── options.md │ │ ├── paths.md │ │ ├── primitives.md │ │ ├── scope.md │ │ ├── symbols.md │ │ ├── text.md │ │ └── transforms.md │ └── mac │ │ ├── blocks.md │ │ ├── bounds.md │ │ ├── builders.md │ │ ├── camera-control.md │ │ ├── cameras.md │ │ ├── commands.md │ │ ├── comments.md │ │ ├── control-flow.md │ │ ├── csg.md │ │ ├── debugging.md │ │ ├── examples.md │ │ ├── export.md │ │ ├── expressions.md │ │ ├── functions.md │ │ ├── getting-started.md │ │ ├── glossary.md │ │ ├── groups.md │ │ ├── import.md │ │ ├── index.md │ │ ├── lights.md │ │ ├── literals.md │ │ ├── materials.md │ │ ├── options.md │ │ ├── paths.md │ │ ├── primitives.md │ │ ├── scope.md │ │ ├── symbols.md │ │ ├── text.md │ │ └── transforms.md ├── 1.5.6 │ ├── ios │ │ ├── blocks.md │ │ ├── bounds.md │ │ ├── builders.md │ │ ├── camera-control.md │ │ ├── cameras.md │ │ ├── commands.md │ │ ├── comments.md │ │ ├── control-flow.md │ │ ├── csg.md │ │ ├── debugging.md │ │ ├── examples.md │ │ ├── export.md │ │ ├── expressions.md │ │ ├── functions.md │ │ ├── getting-started.md │ │ ├── glossary.md │ │ ├── groups.md │ │ ├── import.md │ │ ├── index.md │ │ ├── lights.md │ │ ├── literals.md │ │ ├── materials.md │ │ ├── options.md │ │ ├── paths.md │ │ ├── primitives.md │ │ ├── scope.md │ │ ├── symbols.md │ │ ├── text.md │ │ └── transforms.md │ └── mac │ │ ├── blocks.md │ │ ├── bounds.md │ │ ├── builders.md │ │ ├── camera-control.md │ │ ├── cameras.md │ │ ├── commands.md │ │ ├── comments.md │ │ ├── control-flow.md │ │ ├── csg.md │ │ ├── debugging.md │ │ ├── examples.md │ │ ├── export.md │ │ ├── expressions.md │ │ ├── functions.md │ │ ├── getting-started.md │ │ ├── glossary.md │ │ ├── groups.md │ │ ├── import.md │ │ ├── index.md │ │ ├── lights.md │ │ ├── literals.md │ │ ├── materials.md │ │ ├── options.md │ │ ├── paths.md │ │ ├── primitives.md │ │ ├── scope.md │ │ ├── symbols.md │ │ ├── text.md │ │ └── transforms.md ├── 1.5.7 ├── 1.5.8 ├── 1.5.9 ├── 1.6.0 │ ├── ios │ │ ├── blocks.md │ │ ├── bounds.md │ │ ├── builders.md │ │ ├── camera-control.md │ │ ├── cameras.md │ │ ├── commands.md │ │ ├── comments.md │ │ ├── control-flow.md │ │ ├── csg.md │ │ ├── debugging.md │ │ ├── examples.md │ │ ├── export.md │ │ ├── expressions.md │ │ ├── functions.md │ │ ├── getting-started.md │ │ ├── glossary.md │ │ ├── groups.md │ │ ├── import.md │ │ ├── index.md │ │ ├── lights.md │ │ ├── literals.md │ │ ├── materials.md │ │ ├── meshes.md │ │ ├── options.md │ │ ├── paths.md │ │ ├── primitives.md │ │ ├── scope.md │ │ ├── symbols.md │ │ ├── text.md │ │ └── transforms.md │ └── mac │ │ ├── blocks.md │ │ ├── bounds.md │ │ ├── builders.md │ │ ├── camera-control.md │ │ ├── cameras.md │ │ ├── commands.md │ │ ├── comments.md │ │ ├── control-flow.md │ │ ├── csg.md │ │ ├── debugging.md │ │ ├── examples.md │ │ ├── export.md │ │ ├── expressions.md │ │ ├── functions.md │ │ ├── getting-started.md │ │ ├── glossary.md │ │ ├── groups.md │ │ ├── import.md │ │ ├── index.md │ │ ├── lights.md │ │ ├── literals.md │ │ ├── materials.md │ │ ├── meshes.md │ │ ├── options.md │ │ ├── paths.md │ │ ├── primitives.md │ │ ├── scope.md │ │ ├── symbols.md │ │ ├── text.md │ │ └── transforms.md ├── 1.6.1 │ ├── ios │ │ ├── blocks.md │ │ ├── bounds.md │ │ ├── builders.md │ │ ├── camera-control.md │ │ ├── cameras.md │ │ ├── commands.md │ │ ├── comments.md │ │ ├── control-flow.md │ │ ├── csg.md │ │ ├── debugging.md │ │ ├── examples.md │ │ ├── export.md │ │ ├── expressions.md │ │ ├── functions.md │ │ ├── getting-started.md │ │ ├── glossary.md │ │ ├── groups.md │ │ ├── import.md │ │ ├── index.md │ │ ├── lights.md │ │ ├── literals.md │ │ ├── materials.md │ │ ├── meshes.md │ │ ├── options.md │ │ ├── paths.md │ │ ├── primitives.md │ │ ├── scope.md │ │ ├── symbols.md │ │ ├── text.md │ │ └── transforms.md │ └── mac │ │ ├── blocks.md │ │ ├── bounds.md │ │ ├── builders.md │ │ ├── camera-control.md │ │ ├── cameras.md │ │ ├── commands.md │ │ ├── comments.md │ │ ├── control-flow.md │ │ ├── csg.md │ │ ├── debugging.md │ │ ├── examples.md │ │ ├── export.md │ │ ├── expressions.md │ │ ├── functions.md │ │ ├── getting-started.md │ │ ├── glossary.md │ │ ├── groups.md │ │ ├── import.md │ │ ├── index.md │ │ ├── lights.md │ │ ├── literals.md │ │ ├── materials.md │ │ ├── meshes.md │ │ ├── options.md │ │ ├── paths.md │ │ ├── primitives.md │ │ ├── scope.md │ │ ├── symbols.md │ │ ├── text.md │ │ └── transforms.md ├── 1.6.10 ├── 1.6.11 ├── 1.6.12 │ ├── ios │ │ ├── blocks.md │ │ ├── bounds.md │ │ ├── builders.md │ │ ├── camera-control.md │ │ ├── cameras.md │ │ ├── commands.md │ │ ├── comments.md │ │ ├── control-flow.md │ │ ├── csg.md │ │ ├── debugging.md │ │ ├── examples.md │ │ ├── export.md │ │ ├── expressions.md │ │ ├── functions.md │ │ ├── getting-started.md │ │ ├── glossary.md │ │ ├── groups.md │ │ ├── import.md │ │ ├── index.md │ │ ├── lights.md │ │ ├── literals.md │ │ ├── materials.md │ │ ├── meshes.md │ │ ├── options.md │ │ ├── paths.md │ │ ├── primitives.md │ │ ├── scope.md │ │ ├── symbols.md │ │ ├── text.md │ │ └── transforms.md │ └── mac │ │ ├── blocks.md │ │ ├── bounds.md │ │ ├── builders.md │ │ ├── camera-control.md │ │ ├── cameras.md │ │ ├── commands.md │ │ ├── comments.md │ │ ├── control-flow.md │ │ ├── csg.md │ │ ├── debugging.md │ │ ├── examples.md │ │ ├── export.md │ │ ├── expressions.md │ │ ├── functions.md │ │ ├── getting-started.md │ │ ├── glossary.md │ │ ├── groups.md │ │ ├── import.md │ │ ├── index.md │ │ ├── lights.md │ │ ├── literals.md │ │ ├── materials.md │ │ ├── meshes.md │ │ ├── options.md │ │ ├── paths.md │ │ ├── primitives.md │ │ ├── scope.md │ │ ├── symbols.md │ │ ├── text.md │ │ └── transforms.md ├── 1.6.13 ├── 1.6.14 ├── 1.6.2 ├── 1.6.3 │ ├── ios │ │ ├── blocks.md │ │ ├── bounds.md │ │ ├── builders.md │ │ ├── camera-control.md │ │ ├── cameras.md │ │ ├── commands.md │ │ ├── comments.md │ │ ├── control-flow.md │ │ ├── csg.md │ │ ├── debugging.md │ │ ├── examples.md │ │ ├── export.md │ │ ├── expressions.md │ │ ├── functions.md │ │ ├── getting-started.md │ │ ├── glossary.md │ │ ├── groups.md │ │ ├── import.md │ │ ├── index.md │ │ ├── lights.md │ │ ├── literals.md │ │ ├── materials.md │ │ ├── meshes.md │ │ ├── options.md │ │ ├── paths.md │ │ ├── primitives.md │ │ ├── scope.md │ │ ├── symbols.md │ │ ├── text.md │ │ └── transforms.md │ └── mac │ │ ├── blocks.md │ │ ├── bounds.md │ │ ├── builders.md │ │ ├── camera-control.md │ │ ├── cameras.md │ │ ├── commands.md │ │ ├── comments.md │ │ ├── control-flow.md │ │ ├── csg.md │ │ ├── debugging.md │ │ ├── examples.md │ │ ├── export.md │ │ ├── expressions.md │ │ ├── functions.md │ │ ├── getting-started.md │ │ ├── glossary.md │ │ ├── groups.md │ │ ├── import.md │ │ ├── index.md │ │ ├── lights.md │ │ ├── literals.md │ │ ├── materials.md │ │ ├── meshes.md │ │ ├── options.md │ │ ├── paths.md │ │ ├── primitives.md │ │ ├── scope.md │ │ ├── symbols.md │ │ ├── text.md │ │ └── transforms.md ├── 1.6.4 ├── 1.6.5 ├── 1.6.6 ├── 1.6.7 │ ├── ios │ │ ├── blocks.md │ │ ├── bounds.md │ │ ├── builders.md │ │ ├── camera-control.md │ │ ├── cameras.md │ │ ├── commands.md │ │ ├── comments.md │ │ ├── control-flow.md │ │ ├── csg.md │ │ ├── debugging.md │ │ ├── examples.md │ │ ├── export.md │ │ ├── expressions.md │ │ ├── functions.md │ │ ├── getting-started.md │ │ ├── glossary.md │ │ ├── groups.md │ │ ├── import.md │ │ ├── index.md │ │ ├── lights.md │ │ ├── literals.md │ │ ├── materials.md │ │ ├── meshes.md │ │ ├── options.md │ │ ├── paths.md │ │ ├── primitives.md │ │ ├── scope.md │ │ ├── symbols.md │ │ ├── text.md │ │ └── transforms.md │ └── mac │ │ ├── blocks.md │ │ ├── bounds.md │ │ ├── builders.md │ │ ├── camera-control.md │ │ ├── cameras.md │ │ ├── commands.md │ │ ├── comments.md │ │ ├── control-flow.md │ │ ├── csg.md │ │ ├── debugging.md │ │ ├── examples.md │ │ ├── export.md │ │ ├── expressions.md │ │ ├── functions.md │ │ ├── getting-started.md │ │ ├── glossary.md │ │ ├── groups.md │ │ ├── import.md │ │ ├── index.md │ │ ├── lights.md │ │ ├── literals.md │ │ ├── materials.md │ │ ├── meshes.md │ │ ├── options.md │ │ ├── paths.md │ │ ├── primitives.md │ │ ├── scope.md │ │ ├── symbols.md │ │ ├── text.md │ │ └── transforms.md ├── 1.6.8 ├── 1.6.9 ├── 1.7.0 ├── 1.7.1 │ ├── ios │ │ ├── blocks.md │ │ ├── bounds.md │ │ ├── builders.md │ │ ├── camera-control.md │ │ ├── cameras.md │ │ ├── commands.md │ │ ├── comments.md │ │ ├── control-flow.md │ │ ├── csg.md │ │ ├── debugging.md │ │ ├── examples.md │ │ ├── export.md │ │ ├── expressions.md │ │ ├── functions.md │ │ ├── getting-started.md │ │ ├── glossary.md │ │ ├── groups.md │ │ ├── import.md │ │ ├── index.md │ │ ├── lights.md │ │ ├── literals.md │ │ ├── materials.md │ │ ├── meshes.md │ │ ├── options.md │ │ ├── paths.md │ │ ├── primitives.md │ │ ├── scope.md │ │ ├── symbols.md │ │ ├── text.md │ │ └── transforms.md │ └── mac │ │ ├── blocks.md │ │ ├── bounds.md │ │ ├── builders.md │ │ ├── camera-control.md │ │ ├── cameras.md │ │ ├── commands.md │ │ ├── comments.md │ │ ├── control-flow.md │ │ ├── csg.md │ │ ├── debugging.md │ │ ├── examples.md │ │ ├── export.md │ │ ├── expressions.md │ │ ├── functions.md │ │ ├── getting-started.md │ │ ├── glossary.md │ │ ├── groups.md │ │ ├── import.md │ │ ├── index.md │ │ ├── lights.md │ │ ├── literals.md │ │ ├── materials.md │ │ ├── meshes.md │ │ ├── options.md │ │ ├── paths.md │ │ ├── primitives.md │ │ ├── scope.md │ │ ├── symbols.md │ │ ├── text.md │ │ └── transforms.md ├── 1.8.0 │ ├── ios │ │ ├── blocks.md │ │ ├── bounds.md │ │ ├── builders.md │ │ ├── camera-control.md │ │ ├── cameras.md │ │ ├── commands.md │ │ ├── comments.md │ │ ├── control-flow.md │ │ ├── csg.md │ │ ├── debugging.md │ │ ├── examples.md │ │ ├── export.md │ │ ├── expressions.md │ │ ├── functions.md │ │ ├── getting-started.md │ │ ├── glossary.md │ │ ├── groups.md │ │ ├── import.md │ │ ├── index.md │ │ ├── lights.md │ │ ├── literals.md │ │ ├── materials.md │ │ ├── meshes.md │ │ ├── options.md │ │ ├── paths.md │ │ ├── primitives.md │ │ ├── scope.md │ │ ├── symbols.md │ │ ├── text.md │ │ └── transforms.md │ └── mac │ │ ├── blocks.md │ │ ├── bounds.md │ │ ├── builders.md │ │ ├── camera-control.md │ │ ├── cameras.md │ │ ├── commands.md │ │ ├── comments.md │ │ ├── control-flow.md │ │ ├── csg.md │ │ ├── debugging.md │ │ ├── examples.md │ │ ├── export.md │ │ ├── expressions.md │ │ ├── functions.md │ │ ├── getting-started.md │ │ ├── glossary.md │ │ ├── groups.md │ │ ├── import.md │ │ ├── index.md │ │ ├── lights.md │ │ ├── literals.md │ │ ├── materials.md │ │ ├── meshes.md │ │ ├── options.md │ │ ├── paths.md │ │ ├── primitives.md │ │ ├── scope.md │ │ ├── symbols.md │ │ ├── text.md │ │ └── transforms.md ├── 1.8.1 │ ├── ios │ │ ├── blocks.md │ │ ├── bounds.md │ │ ├── builders.md │ │ ├── camera-control.md │ │ ├── cameras.md │ │ ├── commands.md │ │ ├── comments.md │ │ ├── control-flow.md │ │ ├── csg.md │ │ ├── debugging.md │ │ ├── examples.md │ │ ├── export.md │ │ ├── expressions.md │ │ ├── functions.md │ │ ├── getting-started.md │ │ ├── glossary.md │ │ ├── groups.md │ │ ├── import.md │ │ ├── index.md │ │ ├── lights.md │ │ ├── literals.md │ │ ├── materials.md │ │ ├── meshes.md │ │ ├── options.md │ │ ├── paths.md │ │ ├── primitives.md │ │ ├── scope.md │ │ ├── symbols.md │ │ ├── text.md │ │ └── transforms.md │ └── mac │ │ ├── blocks.md │ │ ├── bounds.md │ │ ├── builders.md │ │ ├── camera-control.md │ │ ├── cameras.md │ │ ├── commands.md │ │ ├── comments.md │ │ ├── control-flow.md │ │ ├── csg.md │ │ ├── debugging.md │ │ ├── examples.md │ │ ├── export.md │ │ ├── expressions.md │ │ ├── functions.md │ │ ├── getting-started.md │ │ ├── glossary.md │ │ ├── groups.md │ │ ├── import.md │ │ ├── index.md │ │ ├── lights.md │ │ ├── literals.md │ │ ├── materials.md │ │ ├── meshes.md │ │ ├── options.md │ │ ├── paths.md │ │ ├── primitives.md │ │ ├── scope.md │ │ ├── symbols.md │ │ ├── text.md │ │ └── transforms.md ├── 1.8.10 ├── 1.8.2 ├── 1.8.3 ├── 1.8.4 │ ├── ios │ │ ├── blocks.md │ │ ├── bounds.md │ │ ├── builders.md │ │ ├── camera-control.md │ │ ├── cameras.md │ │ ├── commands.md │ │ ├── comments.md │ │ ├── control-flow.md │ │ ├── csg.md │ │ ├── debugging.md │ │ ├── examples.md │ │ ├── export.md │ │ ├── expressions.md │ │ ├── functions.md │ │ ├── getting-started.md │ │ ├── glossary.md │ │ ├── groups.md │ │ ├── import.md │ │ ├── index.md │ │ ├── lights.md │ │ ├── literals.md │ │ ├── materials.md │ │ ├── meshes.md │ │ ├── options.md │ │ ├── paths.md │ │ ├── primitives.md │ │ ├── scope.md │ │ ├── symbols.md │ │ ├── text.md │ │ └── transforms.md │ └── mac │ │ ├── blocks.md │ │ ├── bounds.md │ │ ├── builders.md │ │ ├── camera-control.md │ │ ├── cameras.md │ │ ├── commands.md │ │ ├── comments.md │ │ ├── control-flow.md │ │ ├── csg.md │ │ ├── debugging.md │ │ ├── examples.md │ │ ├── export.md │ │ ├── expressions.md │ │ ├── functions.md │ │ ├── getting-started.md │ │ ├── glossary.md │ │ ├── groups.md │ │ ├── import.md │ │ ├── index.md │ │ ├── lights.md │ │ ├── literals.md │ │ ├── materials.md │ │ ├── meshes.md │ │ ├── options.md │ │ ├── paths.md │ │ ├── primitives.md │ │ ├── scope.md │ │ ├── symbols.md │ │ ├── text.md │ │ └── transforms.md ├── 1.8.5 ├── 1.8.6 │ ├── ios │ │ ├── blocks.md │ │ ├── bounds.md │ │ ├── builders.md │ │ ├── camera-control.md │ │ ├── cameras.md │ │ ├── commands.md │ │ ├── comments.md │ │ ├── control-flow.md │ │ ├── csg.md │ │ ├── debugging.md │ │ ├── examples.md │ │ ├── export.md │ │ ├── expressions.md │ │ ├── functions.md │ │ ├── getting-started.md │ │ ├── glossary.md │ │ ├── groups.md │ │ ├── import.md │ │ ├── index.md │ │ ├── lights.md │ │ ├── literals.md │ │ ├── materials.md │ │ ├── meshes.md │ │ ├── options.md │ │ ├── paths.md │ │ ├── primitives.md │ │ ├── scope.md │ │ ├── symbols.md │ │ ├── text.md │ │ └── transforms.md │ └── mac │ │ ├── blocks.md │ │ ├── bounds.md │ │ ├── builders.md │ │ ├── camera-control.md │ │ ├── cameras.md │ │ ├── commands.md │ │ ├── comments.md │ │ ├── control-flow.md │ │ ├── csg.md │ │ ├── debugging.md │ │ ├── examples.md │ │ ├── export.md │ │ ├── expressions.md │ │ ├── functions.md │ │ ├── getting-started.md │ │ ├── glossary.md │ │ ├── groups.md │ │ ├── import.md │ │ ├── index.md │ │ ├── lights.md │ │ ├── literals.md │ │ ├── materials.md │ │ ├── meshes.md │ │ ├── options.md │ │ ├── paths.md │ │ ├── primitives.md │ │ ├── scope.md │ │ ├── symbols.md │ │ ├── text.md │ │ └── transforms.md ├── 1.8.7 │ ├── ios │ │ ├── blocks.md │ │ ├── bounds.md │ │ ├── builders.md │ │ ├── camera-control.md │ │ ├── cameras.md │ │ ├── commands.md │ │ ├── comments.md │ │ ├── control-flow.md │ │ ├── csg.md │ │ ├── debugging.md │ │ ├── examples.md │ │ ├── export.md │ │ ├── expressions.md │ │ ├── functions.md │ │ ├── getting-started.md │ │ ├── glossary.md │ │ ├── groups.md │ │ ├── import.md │ │ ├── index.md │ │ ├── lights.md │ │ ├── literals.md │ │ ├── materials.md │ │ ├── meshes.md │ │ ├── options.md │ │ ├── paths.md │ │ ├── primitives.md │ │ ├── scope.md │ │ ├── symbols.md │ │ ├── text.md │ │ └── transforms.md │ └── mac │ │ ├── blocks.md │ │ ├── bounds.md │ │ ├── builders.md │ │ ├── camera-control.md │ │ ├── cameras.md │ │ ├── commands.md │ │ ├── comments.md │ │ ├── control-flow.md │ │ ├── csg.md │ │ ├── debugging.md │ │ ├── examples.md │ │ ├── export.md │ │ ├── expressions.md │ │ ├── functions.md │ │ ├── getting-started.md │ │ ├── glossary.md │ │ ├── groups.md │ │ ├── import.md │ │ ├── index.md │ │ ├── lights.md │ │ ├── literals.md │ │ ├── materials.md │ │ ├── meshes.md │ │ ├── options.md │ │ ├── paths.md │ │ ├── primitives.md │ │ ├── scope.md │ │ ├── symbols.md │ │ ├── text.md │ │ └── transforms.md ├── 1.8.8 │ ├── ios │ │ ├── blocks.md │ │ ├── bounds.md │ │ ├── builders.md │ │ ├── camera-control.md │ │ ├── cameras.md │ │ ├── commands.md │ │ ├── comments.md │ │ ├── control-flow.md │ │ ├── csg.md │ │ ├── debugging.md │ │ ├── examples.md │ │ ├── export.md │ │ ├── expressions.md │ │ ├── functions.md │ │ ├── getting-started.md │ │ ├── glossary.md │ │ ├── groups.md │ │ ├── import.md │ │ ├── index.md │ │ ├── lights.md │ │ ├── literals.md │ │ ├── materials.md │ │ ├── meshes.md │ │ ├── options.md │ │ ├── paths.md │ │ ├── primitives.md │ │ ├── scope.md │ │ ├── symbols.md │ │ ├── text.md │ │ └── transforms.md │ └── mac │ │ ├── blocks.md │ │ ├── bounds.md │ │ ├── builders.md │ │ ├── camera-control.md │ │ ├── cameras.md │ │ ├── commands.md │ │ ├── comments.md │ │ ├── control-flow.md │ │ ├── csg.md │ │ ├── debugging.md │ │ ├── examples.md │ │ ├── export.md │ │ ├── expressions.md │ │ ├── functions.md │ │ ├── getting-started.md │ │ ├── glossary.md │ │ ├── groups.md │ │ ├── import.md │ │ ├── index.md │ │ ├── lights.md │ │ ├── literals.md │ │ ├── materials.md │ │ ├── meshes.md │ │ ├── options.md │ │ ├── paths.md │ │ ├── primitives.md │ │ ├── scope.md │ │ ├── symbols.md │ │ ├── text.md │ │ └── transforms.md ├── 1.8.9 ├── CNAME ├── images │ ├── arc.png │ ├── axis-aligned-extrusion.png │ ├── ball.png │ ├── box.png │ ├── camera-orientation.png │ ├── checkered-sphere.png │ ├── chessboard.png │ ├── cog.png │ ├── colored-triangle.png │ ├── cone.png │ ├── cube-mesh.png │ ├── curved-slab.png │ ├── custom-camera-menu-ios-1.6.3.png │ ├── custom-camera-menu-ios-1.6.4.png │ ├── custom-camera-menu-ios.png │ ├── custom-camera-menu.png │ ├── custom-camera.png │ ├── custom-fov.png │ ├── cylinder.png │ ├── detail.png │ ├── earth.png │ ├── error-screen-ios-1.6.3.png │ ├── error-screen-ios-1.6.4.png │ ├── error-screen-ios.png │ ├── error-screen-mac.png │ ├── even-odd-fill.png │ ├── export-size-ios.png │ ├── export-size.png │ ├── filled-pentagon.png │ ├── green-glow.png │ ├── group-vs-difference.png │ ├── group-vs-union.png │ ├── group.png │ ├── hull-vs-loft.png │ ├── hull.png │ ├── icosahedron.png │ ├── intersection.png │ ├── left-light.png │ ├── line.png │ ├── linespacing-decreased.png │ ├── linespacing-increased.png │ ├── loading-ios.png │ ├── loading.png │ ├── loftshape.png │ ├── metallicity.png │ ├── moon-debug.png │ ├── moon.png │ ├── new-document-ios-1.6.3.png │ ├── new-document-ios-1.6.4.png │ ├── new-document-ios.png │ ├── new-document-mac.png │ ├── new-file-ios.png │ ├── normal-map.png │ ├── not-watertight.png │ ├── numbers.png │ ├── object-info-ios-1.6.3.png │ ├── object-info-ios-1.6.4.png │ ├── object-info-ios.png │ ├── object-info-mac.png │ ├── octocircle.png │ ├── orthographic-camera.png │ ├── overlapping-circles.png │ ├── path-colors.png │ ├── pawn-profile.png │ ├── pawn.png │ ├── pentagon.png │ ├── point-light.png │ ├── polygon-vs-circle.png │ ├── prism.png │ ├── quarter-circle.png │ ├── rectangle.png │ ├── roundrect-extrusion.png │ ├── roundrect.png │ ├── sandbox-error-ios-1.6.3.png │ ├── sandbox-error-ios-1.6.4.png │ ├── sandbox-error-ios.png │ ├── sandbox-error.png │ ├── semicircle.png │ ├── show-axes-ios-1.6.3.png │ ├── show-axes-ios-1.6.4.png │ ├── show-axes-ios.png │ ├── show-axes-mac.png │ ├── six-pointed-star.png │ ├── smooth-arc.png │ ├── smoothed-hull.png │ ├── smoother-sphere.png │ ├── smoothing.png │ ├── solid-text.png │ ├── source-editor-ios.png │ ├── sphere.png │ ├── spheroid.png │ ├── spirals.png │ ├── split-view-ios-1.6.3.png │ ├── split-view-ios-1.6.4.png │ ├── split-view-ios.png │ ├── spotlight-debug.png │ ├── spotlight-sharp.png │ ├── spotlight-wide.png │ ├── spotlight.png │ ├── spring.png │ ├── star-with-fitted-cube.png │ ├── star-with-fitted-rect.png │ ├── star-with-unit-cube.png │ ├── star.png │ ├── stencil.png │ ├── subtext-ios.png │ ├── svgpath.png │ ├── tangential-extrusion.png │ ├── text-centered.png │ ├── text-default.png │ ├── text-font.png │ ├── text-wrap.png │ ├── text.png │ ├── textedit-mac.png │ ├── textured-cone.png │ ├── textured-cube.png │ ├── textured-cylinder.png │ ├── textured-sphere.png │ ├── torus.png │ ├── train.png │ ├── triangle-polygon.png │ ├── triangle.png │ ├── twisted-circle-seam.png │ ├── twisted-circle.png │ ├── twisted-extrusion-wireframe.png │ ├── twisted-extrusion.png │ ├── washed-out.png │ ├── xor.png │ ├── yellow-cube-ios-1.6.3.png │ ├── yellow-cube-ios-1.6.4.png │ ├── yellow-cube-ios.png │ └── yellow-cube-mac.png ├── index.md ├── ios │ ├── blocks.md │ ├── bounds.md │ ├── builders.md │ ├── camera-control.md │ ├── cameras.md │ ├── commands.md │ ├── comments.md │ ├── control-flow.md │ ├── csg.md │ ├── debugging.md │ ├── examples.md │ ├── export.md │ ├── expressions.md │ ├── functions.md │ ├── getting-started.md │ ├── glossary.md │ ├── groups.md │ ├── import.md │ ├── index.md │ ├── lights.md │ ├── literals.md │ ├── materials.md │ ├── meshes.md │ ├── options.md │ ├── paths.md │ ├── primitives.md │ ├── scope.md │ ├── symbols.md │ ├── text.md │ └── transforms.md ├── mac │ ├── blocks.md │ ├── bounds.md │ ├── builders.md │ ├── camera-control.md │ ├── cameras.md │ ├── commands.md │ ├── comments.md │ ├── control-flow.md │ ├── csg.md │ ├── debugging.md │ ├── examples.md │ ├── export.md │ ├── expressions.md │ ├── functions.md │ ├── getting-started.md │ ├── glossary.md │ ├── groups.md │ ├── import.md │ ├── index.md │ ├── lights.md │ ├── literals.md │ ├── materials.md │ ├── meshes.md │ ├── options.md │ ├── paths.md │ ├── primitives.md │ ├── scope.md │ ├── symbols.md │ ├── text.md │ └── transforms.md └── src │ ├── blocks.md │ ├── bounds.md │ ├── builders.md │ ├── camera-control-ios.md │ ├── camera-control.md │ ├── cameras.md │ ├── commands.md │ ├── comments.md │ ├── control-flow.md │ ├── csg.md │ ├── debugging.md │ ├── examples.md │ ├── export-ios.md │ ├── export.md │ ├── expressions.md │ ├── functions.md │ ├── getting-started-ios.md │ ├── getting-started.md │ ├── glossary.md │ ├── groups.md │ ├── import.md │ ├── index.md │ ├── lights.md │ ├── literals.md │ ├── materials.md │ ├── meshes.md │ ├── options.md │ ├── paths.md │ ├── primitives.md │ ├── scope.md │ ├── symbols.md │ ├── text.md │ └── transforms.md └── images ├── Screenshot.jpg ├── app-store-badge.png └── mac-app-store-badge.png /.github/workflows/linux_build.yml: -------------------------------------------------------------------------------- 1 | name: Build for Linux 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | ref: 7 | description: 'Ref to build (branch, tag or SHA)' 8 | required: false 9 | default: 'main' 10 | 11 | jobs: 12 | build: 13 | name: Build ShapeScript for Linux 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v4 17 | with: 18 | ref: ${{ github.event.inputs.ref }} 19 | - name: Build it 20 | run: | 21 | swift build --configuration release --static-swift-stdlib 22 | SWIFTFORMAT_BIN_PATH=`swift build --configuration release --show-bin-path` 23 | mv $SWIFTFORMAT_BIN_PATH/shapescript "${HOME}/shapescript" 24 | - name: 'Upload Artifact' 25 | uses: actions/upload-artifact@v4 26 | with: 27 | name: shapescript_linux 28 | path: ~/shapescript 29 | retention-days: 5 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Mac 2 | .DS_Store 3 | 4 | ## Build generated 5 | build/ 6 | culprits.txt 7 | default.profraw 8 | DerivedData/ 9 | /html 10 | 11 | ## Various settings 12 | *.pbxuser 13 | !default.pbxuser 14 | *.mode1v3 15 | !default.mode1v3 16 | *.mode2v3 17 | !default.mode2v3 18 | *.perspectivev3 19 | !default.perspectivev3 20 | project.xcworkspace/ 21 | xcuserdata/ 22 | 23 | ## Other 24 | *.moved-aside 25 | *.xcuserstate 26 | 27 | ## Obj-C/Swift specific 28 | *.hmap 29 | *.ipa 30 | *.dSYM.zip 31 | *.dSYM 32 | 33 | ## Playgrounds 34 | timeline.xctimeline 35 | playground.xcworkspace 36 | 37 | # Swift Package Manager 38 | # 39 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 40 | # Packages/ 41 | .build/ 42 | .swiftpm/ 43 | Package.resolved 44 | 45 | # CocoaPods 46 | # 47 | # We recommend against adding the Pods directory to your .gitignore. However 48 | # you should judge for yourself, the pros and cons are mentioned at: 49 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 50 | # 51 | # Pods/ 52 | 53 | # Carthage 54 | # 55 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 56 | # Carthage/Checkouts 57 | 58 | Carthage/Build 59 | 60 | # fastlane 61 | # 62 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 63 | # screenshots whenever they are needed. 64 | # For more information about the recommended setup visit: 65 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 66 | 67 | fastlane/report.xml 68 | fastlane/Preview.html 69 | fastlane/screenshots 70 | fastlane/test_output 71 | -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | 5.1 -------------------------------------------------------------------------------- /.swiftformat: -------------------------------------------------------------------------------- 1 | # file options 2 | 3 | --exclude Build, Euclid, LRUCache, SVGPath, Package.swift 4 | 5 | # format options 6 | 7 | --hexgrouping ignore 8 | --decimalgrouping ignore 9 | --ifdef no-indent 10 | --self init-only 11 | --shortoptionals except-properties 12 | --maxwidth 120 13 | 14 | # rules 15 | 16 | --lintonly unusedArguments 17 | --enable isEmpty 18 | -------------------------------------------------------------------------------- /Euclid/.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | Assets/ 6 | build/ 7 | html/ 8 | .build 9 | *.pbxuser 10 | !default.pbxuser 11 | *.mode1v3 12 | !default.mode1v3 13 | *.mode2v3 14 | !default.mode2v3 15 | *.perspectivev3 16 | !default.perspectivev3 17 | xcuserdata 18 | *.xccheckout 19 | *.moved-aside 20 | DerivedData 21 | *.hmap 22 | *.ipa 23 | *.dot 24 | .docc-build/ 25 | all_identifiers.txt 26 | all_symbols.txt 27 | -------------------------------------------------------------------------------- /Euclid/.swift-version: -------------------------------------------------------------------------------- 1 | 5.1 -------------------------------------------------------------------------------- /Euclid/.swiftformat: -------------------------------------------------------------------------------- 1 | # file options 2 | 3 | --exclude Build, Tests/XCTestManifests.swift 4 | 5 | # format options 6 | 7 | --hexgrouping ignore 8 | --decimalgrouping ignore 9 | --ifdef no-indent 10 | --self init-only 11 | --shortoptionals except-properties 12 | --wraparguments before-first 13 | --wrapcollections before-first 14 | --wrapconditions after-first 15 | --maxwidth 120 16 | 17 | # rules 18 | 19 | --lintonly unusedArguments 20 | --enable isEmpty, docComments -------------------------------------------------------------------------------- /Euclid/Euclid.docc/Extensions/Angle.md: -------------------------------------------------------------------------------- 1 | # ``Euclid/Angle`` 2 | 3 | ## Topics 4 | 5 | ### Creating Angles 6 | 7 | - ``Angle/init(degrees:)`` 8 | - ``Angle/init(radians:)`` 9 | - ``Angle/degrees(_:)`` 10 | - ``Angle/radians(_:)`` 11 | 12 | ### Default Angles 13 | 14 | - ``Angle/zero`` 15 | - ``Angle/halfPi`` 16 | - ``Angle/pi`` 17 | - ``Angle/twoPi`` 18 | 19 | ### Angle Properties 20 | 21 | - ``Angle/degrees`` 22 | - ``Angle/radians`` 23 | - ``Angle/isZero`` 24 | 25 | ### Computing Angles 26 | 27 | - ``Angle/acos(_:)`` 28 | - ``Angle/asin(_:)`` 29 | - ``Angle/atan(_:)`` 30 | - ``Angle/atan2(y:x:)`` 31 | 32 | ### Operators 33 | 34 | - ``Angle/+(_:_:)`` 35 | - ``Angle/+=(_:_:)`` 36 | - ``Angle/-(_:)`` 37 | - ``Angle/-(_:_:)`` 38 | - ``Angle/-=(_:_:)`` 39 | - ``Angle/*(_:_:)-2ew65`` 40 | - ``Angle/*(_:_:)-8l78z`` 41 | - ``Angle/*=(_:_:)`` 42 | - ``Angle//(_:_:)`` 43 | - ``Angle//=(_:_:)`` 44 | -------------------------------------------------------------------------------- /Euclid/Euclid.docc/Extensions/Bounds.md: -------------------------------------------------------------------------------- 1 | # ``Euclid/Bounds`` 2 | 3 | ## Topics 4 | 5 | ### Creating Bounds 6 | 7 | - ``Bounds/init(_:)-1icmf`` 8 | - ``Bounds/init(_:)-27jri`` 9 | - ``Bounds/init(min:max:)`` 10 | - ``Bounds/init(_:_:)`` 11 | 12 | ### Default Bounds 13 | 14 | - ``Bounds/empty`` 15 | 16 | ### Bounds Properties 17 | 18 | - ``Bounds/min`` 19 | - ``Bounds/max`` 20 | - ``Bounds/size`` 21 | - ``Bounds/center`` 22 | - ``Bounds/corners`` 23 | - ``Bounds/isEmpty`` 24 | 25 | ### Comparing Bounds 26 | 27 | - ``Bounds/containsPoint(_:)`` 28 | - ``Bounds/intersects(_:)-7br6p`` 29 | - ``Bounds/intersects(_:)-95v17`` 30 | 31 | ### Combining and Modifying Bounds 32 | 33 | - ``Bounds/inset(by:)-49ykf`` 34 | - ``Bounds/inset(by:)-4gk62`` 35 | - ``Bounds/intersection(_:)`` 36 | - ``Bounds/union(_:)`` 37 | - ``Bounds/formIntersection(_:)`` 38 | - ``Bounds/formUnion(_:)`` 39 | 40 | ### Transforming Bounds 41 | 42 | - ``Bounds/rotated(by:)`` 43 | - ``Bounds/scaled(by:)-5dvvh`` 44 | - ``Bounds/scaled(by:)-6epo6`` 45 | - ``Bounds/translated(by:)`` 46 | - ``Bounds/transformed(by:)`` 47 | -------------------------------------------------------------------------------- /Euclid/Euclid.docc/Extensions/Color.md: -------------------------------------------------------------------------------- 1 | # ``Euclid/Color`` 2 | 3 | ## Topics 4 | 5 | ### Creating a Color 6 | 7 | - ``Color/init(_:_:_:_:)`` 8 | - ``Color/init(_:_:)`` 9 | - ``Color/init(_:)-25eby`` 10 | - ``Color/init(_:)-53lhy`` 11 | - ``Color/init(_:)-7d8un`` 12 | 13 | ### Default Colors 14 | 15 | - ``Color/clear`` 16 | - ``Color/black`` 17 | - ``Color/white`` 18 | - ``Color/gray`` 19 | - ``Color/red`` 20 | - ``Color/green`` 21 | - ``Color/blue`` 22 | - ``Color/yellow`` 23 | - ``Color/cyan`` 24 | - ``Color/magenta`` 25 | - ``Color/orange`` 26 | 27 | ### Color properties 28 | 29 | - ``Color/r`` 30 | - ``Color/g`` 31 | - ``Color/b`` 32 | - ``Color/a`` 33 | 34 | ### Mutating Colors 35 | 36 | - ``Color/withAlpha(_:)`` 37 | -------------------------------------------------------------------------------- /Euclid/Euclid.docc/Extensions/Line.md: -------------------------------------------------------------------------------- 1 | # ``Euclid/Line`` 2 | 3 | ## Topics 4 | 5 | ### Creating Lines 6 | 7 | - ``Line/init(_:)`` 8 | - ``Line/init(origin:direction:)`` 9 | 10 | ### Line Properties 11 | 12 | - ``Line/origin`` 13 | - ``Line/direction`` 14 | 15 | ### Comparing Lines 16 | 17 | - ``Line/containsPoint(_:)`` 18 | - ``Line/distance(from:)-4o41`` 19 | - ``Line/distance(from:)-77i61`` 20 | - ``Line/intersection(with:)-2nysu`` 21 | - ``Line/intersection(with:)-7s1sd`` 22 | - ``Line/intersects(_:)`` 23 | -------------------------------------------------------------------------------- /Euclid/Euclid.docc/Extensions/LineSegment.md: -------------------------------------------------------------------------------- 1 | # ``Euclid/LineSegment`` 2 | 3 | ## Topics 4 | 5 | ### Creating Line Segments 6 | 7 | - ``LineSegment/init(_:_:)`` 8 | 9 | ### Line Segment Properties 10 | 11 | - ``LineSegment/start`` 12 | - ``LineSegment/end`` 13 | - ``LineSegment/length`` 14 | - ``LineSegment/direction`` 15 | 16 | ### Comparing Line Segments 17 | 18 | - ``LineSegment/containsPoint(_:)`` 19 | - ``LineSegment/intersection(with:)-1tffl`` 20 | - ``LineSegment/intersection(with:)-2u7vo`` 21 | - ``LineSegment/intersects(_:)`` 22 | 23 | ### Transforming Line Segments 24 | 25 | - ``LineSegment/rotated(by:)`` 26 | - ``LineSegment/scaled(by:)-2lm8c`` 27 | - ``LineSegment/scaled(by:)-37r1v`` 28 | - ``LineSegment/translated(by:)`` 29 | - ``LineSegment/transformed(by:)`` 30 | - ``LineSegment/inverted()`` 31 | -------------------------------------------------------------------------------- /Euclid/Euclid.docc/Extensions/Path.md: -------------------------------------------------------------------------------- 1 | # ``Euclid/Path`` 2 | 3 | ## Topics 4 | 5 | ### Default Paths 6 | 7 | - ``Path/empty`` 8 | 9 | ### Creating Paths 10 | 11 | - ``Path/init(_:)-3c0eo`` 12 | - ``Path/init(_:)-4jhkw`` 13 | - ``Path/init(subpaths:)`` 14 | - ``Path/init(_:detail:color:)`` 15 | - ``Path/curve(_:detail:)`` 16 | - ``Path/line(_:_:color:)`` 17 | - ``Path/line(_:color:)`` 18 | - ``Path/arc(angle:radius:segments:color:)`` 19 | 20 | ### Creating Shape Paths 21 | 22 | - ``Path/circle(radius:segments:color:)`` 23 | - ``Path/ellipse(width:height:segments:color:)`` 24 | - ``Path/rectangle(width:height:color:)`` 25 | - ``Path/roundedRectangle(width:height:radius:detail:color:)`` 26 | - ``Path/square(size:color:)`` 27 | - ``Path/polygon(radius:sides:color:)`` 28 | 29 | ### Creating Text Paths 30 | 31 | - ``Path/text(_:font:width:detail:)`` 32 | - ``Path/text(_:width:detail:)`` 33 | 34 | ### Path Properties 35 | 36 | - ``Path/points`` 37 | - ``Path/plane`` 38 | - ``Path/bounds`` 39 | - ``Path/length`` 40 | - ``Path/isClosed`` 41 | - ``Path/isPlanar`` 42 | 43 | ### Transforming Paths 44 | 45 | - ``Path/rotated(by:)`` 46 | - ``Path/scaled(by:)-19jpq`` 47 | - ``Path/scaled(by:)-84xdd`` 48 | - ``Path/translated(by:)`` 49 | - ``Path/transformed(by:)`` 50 | - ``Path/withColor(_:)`` 51 | - ``Path/closed()`` 52 | -------------------------------------------------------------------------------- /Euclid/Euclid.docc/Extensions/PathPoint.md: -------------------------------------------------------------------------------- 1 | # ``Euclid/PathPoint`` 2 | 3 | ## Topics 4 | 5 | ### Creating Path Points 6 | 7 | - ``PathPoint/init(_:texcoord:color:isCurved:)`` 8 | - ``PathPoint/init(_:)`` 9 | - ``PathPoint/point(_:_:_:texcoord:color:)`` 10 | - ``PathPoint/point(_:texcoord:color:)`` 11 | - ``PathPoint/curve(_:_:_:texcoord:color:)`` 12 | - ``PathPoint/curve(_:texcoord:color:)`` 13 | 14 | ### Path Point Properties 15 | 16 | - ``PathPoint/position`` 17 | - ``PathPoint/color`` 18 | - ``PathPoint/texcoord`` 19 | - ``PathPoint/isCurved`` 20 | 21 | ### Interpolating Path Points 22 | 23 | - ``PathPoint/lerp(_:_:)`` 24 | 25 | ### Transforming Path Points 26 | 27 | - ``PathPoint/rotated(by:)`` 28 | - ``PathPoint/scaled(by:)-4wtbg`` 29 | - ``PathPoint/scaled(by:)-7e3o7`` 30 | - ``PathPoint/translated(by:)`` 31 | - ``PathPoint/transformed(by:)`` 32 | - ``PathPoint/withColor(_:)`` 33 | - ``PathPoint/curved(_:)`` 34 | -------------------------------------------------------------------------------- /Euclid/Euclid.docc/Extensions/Plane.md: -------------------------------------------------------------------------------- 1 | # ``Euclid/Plane`` 2 | 3 | ## Topics 4 | 5 | ### Creating Planes 6 | 7 | - ``Plane/init(normal:pointOnPlane:)`` 8 | - ``Plane/init(points:)`` 9 | 10 | ### Default Planes 11 | 12 | - ``Plane/xy`` 13 | - ``Plane/xz`` 14 | - ``Plane/yz`` 15 | 16 | ### Plane Properties 17 | 18 | - ``Plane/normal`` 19 | - ``Plane/w`` 20 | 21 | ### Comparing Planes 22 | 23 | - ``Plane/containsPoint(_:)`` 24 | - ``Plane/distance(from:)`` 25 | - ``Plane/intersection(with:)-4v7tg`` 26 | - ``Plane/intersection(with:)-79olr`` 27 | 28 | ### Transforming Planes 29 | 30 | - ``Plane/inverted()`` 31 | - ``Plane/rotated(by:)`` 32 | - ``Plane/scaled(by:)-29v7y`` 33 | - ``Plane/scaled(by:)-6axqe`` 34 | - ``Plane/translated(by:)`` 35 | - ``Plane/transformed(by:)`` 36 | -------------------------------------------------------------------------------- /Euclid/Euclid.docc/Extensions/Polygon.md: -------------------------------------------------------------------------------- 1 | # ``Euclid/Polygon`` 2 | 3 | ## Topics 4 | 5 | ### Creating Polygons 6 | 7 | - ``Polygon/init(_:material:)-8gsiw`` 8 | - ``Polygon/init(_:material:)-9mns5`` 9 | - ``Polygon/init(shape:material:)`` 10 | 11 | ### Polygon Properties 12 | 13 | - ``Polygon/vertices`` 14 | - ``Polygon/plane`` 15 | - ``Polygon/bounds`` 16 | - ``Polygon/center`` 17 | - ``Polygon/material-swift.property`` 18 | - ``Polygon/isConvex`` 19 | - ``Polygon/hasTexcoords`` 20 | - ``Polygon/hasVertexColors`` 21 | - ``Polygon/orderedEdges`` 22 | - ``Polygon/undirectedEdges`` 23 | - ``Polygon/area`` 24 | 25 | ### Comparing Polygons 26 | 27 | - ``Polygon/containsPoint(_:)`` 28 | - ``Polygon/edges(intersecting:)`` 29 | 30 | ### Transforming Polygons 31 | 32 | - ``Polygon/rotated(by:)`` 33 | - ``Polygon/scaled(by:)-69m6m`` 34 | - ``Polygon/scaled(by:)-8sjrv`` 35 | - ``Polygon/translated(by:)`` 36 | - ``Polygon/transformed(by:)`` 37 | - ``Polygon/merge(_:ensureConvex:)`` 38 | - ``Polygon/inverted()`` 39 | - ``Polygon/withMaterial(_:)`` 40 | 41 | ### Splitting Polygons 42 | 43 | - ``Polygon/clip(to:)`` 44 | - ``Polygon/split(along:)`` 45 | - ``Polygon/tessellate(maxSides:)`` 46 | - ``Polygon/triangulate()`` -------------------------------------------------------------------------------- /Euclid/Euclid.docc/Extensions/Quaternion.md: -------------------------------------------------------------------------------- 1 | # ``Euclid/Quaternion`` 2 | 3 | ## Topics 4 | 5 | ### Creating Quaternions 6 | 7 | - ``Quaternion/init(_:)-27eol`` 8 | - ``Quaternion/init(_:)-7xa5o`` 9 | - ``Quaternion/init(_:)-b3v3`` 10 | - ``Quaternion/init(_:)-fyhx`` 11 | - ``Quaternion/init(_:_:_:_:)`` 12 | - ``Quaternion/init(axis:angle:)`` 13 | - ``Quaternion/init(roll:yaw:pitch:)`` 14 | - ``Quaternion/pitch(_:)`` 15 | - ``Quaternion/roll(_:)`` 16 | - ``Quaternion/yaw(_:)`` 17 | 18 | ### Default Quaternions 19 | 20 | - ``Quaternion/zero`` 21 | - ``Quaternion/identity`` 22 | 23 | ### Quaternion Properties 24 | 25 | - ``Quaternion/pitch`` 26 | - ``Quaternion/roll`` 27 | - ``Quaternion/yaw`` 28 | - ``Quaternion/axis`` 29 | - ``Quaternion/angle`` 30 | - ``Quaternion/isIdentity`` 31 | 32 | ### Computing Quaternions 33 | 34 | - ``Quaternion/dot(_:)`` 35 | - ``Quaternion/normalized()`` 36 | 37 | ### Interpolating Quaternions 38 | 39 | - ``Quaternion/slerp(_:_:)`` 40 | 41 | ### Operators 42 | 43 | - ``Quaternion/+(_:_:)`` 44 | - ``Quaternion/+=(_:_:)`` 45 | - ``Quaternion/-(_:_:)`` 46 | - ``Quaternion/-(_:)`` 47 | - ``Quaternion/-=(_:_:)`` 48 | - ``Quaternion/*(_:_:)-2drke`` 49 | - ``Quaternion/*(_:_:)-305tn`` 50 | - ``Quaternion/*=(_:_:)-5ic2j`` 51 | - ``Quaternion/*=(_:_:)-lsgo`` 52 | - ``Quaternion//(_:_:)`` 53 | - ``Quaternion//=(_:_:)`` 54 | 55 | -------------------------------------------------------------------------------- /Euclid/Euclid.docc/Extensions/Rotation.md: -------------------------------------------------------------------------------- 1 | # ``Euclid/Rotation`` 2 | 3 | ## Topics 4 | 5 | ### Creating Rotations 6 | 7 | - ``Rotation/init()`` 8 | - ``Rotation/init(_:)-5w6mn`` 9 | - ``Rotation/init(_:)-68leo`` 10 | - ``Rotation/init(_:)-7j4ql`` 11 | - ``Rotation/init(axis:angle:)`` 12 | - ``Rotation/init(pitch:yaw:roll:)`` 13 | - ``Rotation/init(roll:yaw:pitch:)`` 14 | - ``Rotation/init(yaw:pitch:roll:)`` 15 | 16 | ### Default Quaternions 17 | 18 | - ``Rotation/identity`` 19 | 20 | ### Creating Rotations Around an Axis 21 | 22 | - ``Rotation/pitch(_:)`` 23 | - ``Rotation/roll(_:)`` 24 | - ``Rotation/yaw(_:)`` 25 | 26 | ### Rotation Properties 27 | 28 | - ``Rotation/pitch`` 29 | - ``Rotation/roll`` 30 | - ``Rotation/yaw`` 31 | - ``Rotation/axis`` 32 | - ``Rotation/angle`` 33 | - ``Rotation/forward`` 34 | - ``Rotation/right`` 35 | - ``Rotation/up`` 36 | - ``Rotation/isIdentity`` 37 | 38 | ### Interpolating Rotations 39 | 40 | - ``Rotation/slerp(_:_:)`` 41 | 42 | ### Operators 43 | 44 | - ``Rotation/-(_:)`` 45 | - ``Rotation/*(_:_:)-55zcf`` 46 | - ``Rotation/*(_:_:)-5fe82`` 47 | - ``Rotation/*=(_:_:)-68kkw`` 48 | - ``Rotation/*=(_:_:)-7u9hf`` 49 | - ``Rotation//(_:_:)`` 50 | - ``Rotation//=(_:_:)`` -------------------------------------------------------------------------------- /Euclid/Euclid.docc/Extensions/Transform.md: -------------------------------------------------------------------------------- 1 | # ``Euclid/Transform`` 2 | 3 | ## Topics 4 | 5 | ### Creating Transforms 6 | 7 | - ``Transform/init(offset:rotation:scale:)`` 8 | - ``Transform/offset(_:)`` 9 | - ``Transform/rotation(_:)`` 10 | - ``Transform/scale(_:)-55t4p`` 11 | - ``Transform/scale(_:)-7a30s`` 12 | - ``Transform/transform(from:)`` 13 | 14 | ### Default Transforms 15 | 16 | - ``Transform/identity`` 17 | 18 | ### Transform properties 19 | 20 | - ``Transform/rotation`` 21 | - ``Transform/scale`` 22 | - ``Transform/offset`` 23 | - ``Transform/isFlipped`` 24 | - ``Transform/isIdentity`` 25 | 26 | ### Combining Transforms 27 | 28 | - ``Transform/rotated(by:)`` 29 | - ``Transform/scaled(by:)-19ukh`` 30 | - ``Transform/scaled(by:)-9vwak`` 31 | - ``Transform/translated(by:)`` 32 | - ``Transform/transformed(by:)`` 33 | 34 | ### Operators 35 | 36 | - ``Transform/*(_:_:)`` 37 | - ``Transform/*=(_:_:)`` 38 | -------------------------------------------------------------------------------- /Euclid/Euclid.docc/Extensions/Vector.md: -------------------------------------------------------------------------------- 1 | # ``Euclid/Vector`` 2 | 3 | ## Topics 4 | 5 | ### Creating Vectors 6 | 7 | - ``Vector/init(_:)-228p6`` 8 | - ``Vector/init(_:)-4eop9`` 9 | - ``Vector/init(_:)-5n3j`` 10 | - ``Vector/init(_:)-228p6`` 11 | - ``Vector/init(_:)-6nlm`` 12 | - ``Vector/init(_:)-3hpag`` 13 | - ``Vector/init(_:_:_:)`` 14 | - ``Vector/init(size:)-8y52g`` 15 | - ``Vector/init(size:)-nkyk`` 16 | 17 | ### Default Vectors 18 | 19 | - ``Vector/zero`` 20 | - ``Vector/one`` 21 | - ``Vector/unitX`` 22 | - ``Vector/unitY`` 23 | - ``Vector/unitZ`` 24 | 25 | ### Vector Properties 26 | 27 | - ``Vector/x`` 28 | - ``Vector/y`` 29 | - ``Vector/z`` 30 | - ``Vector/length`` 31 | - ``Vector/lengthSquared`` 32 | - ``Vector/isZero`` 33 | - ``Vector/isOne`` 34 | 35 | ### Computing Vectors 36 | 37 | - ``Vector/dot(_:)`` 38 | - ``Vector/cross(_:)`` 39 | 40 | ### Interpolating Vectors 41 | 42 | - ``Vector/lerp(_:_:)`` 43 | 44 | ### Transforming Vectors 45 | 46 | - ``Vector/normalized()`` 47 | - ``Vector/rotated(by:)`` 48 | - ``Vector/scaled(by:)-350oy`` 49 | - ``Vector/scaled(by:)-356zr`` 50 | - ``Vector/translated(by:)`` 51 | - ``Vector/transformed(by:)`` 52 | 53 | ### Comparing Vectors 54 | 55 | - ``Vector/angle(with:)-29paf`` 56 | - ``Vector/angle(with:)-9sfg1`` 57 | - ``Vector/distance(from:)-3eglz`` 58 | - ``Vector/distance(from:)-5p7ko`` 59 | - ``Vector/project(onto:)-817o2`` 60 | - ``Vector/project(onto:)-rksk`` 61 | 62 | ### Operators 63 | 64 | - ``Vector/+(_:_:)`` 65 | - ``Vector/+=(_:_:)`` 66 | - ``Vector/-(_:_:)`` 67 | - ``Vector/-(_:)`` 68 | - ``Vector/-=(_:_:)`` 69 | - ``Vector/*(_:_:)-48gl1`` 70 | - ``Vector/*(_:_:)-5mcy5`` 71 | - ``Vector/*=(_:_:)-3ur4e`` 72 | - ``Vector//(_:_:)`` 73 | - ``Vector//=(_:_:)`` 74 | -------------------------------------------------------------------------------- /Euclid/Euclid.docc/Extensions/Vertex.md: -------------------------------------------------------------------------------- 1 | # ``Euclid/Vertex`` 2 | 3 | ## Topics 4 | 5 | ### Creating Vertices 6 | 7 | - ``init(_:_:_:_:)`` 8 | - ``init(_:)-5517j`` 9 | - ``init(_:)-7go25`` 10 | 11 | ### Vertex Properties 12 | 13 | - ``position`` 14 | - ``normal`` 15 | - ``texcoord`` 16 | - ``color`` 17 | 18 | ### Transforming Vertices 19 | 20 | - ``Vertex/inverted()`` 21 | - ``Vertex/rotated(by:)`` 22 | - ``Vertex/scaled(by:)-1dtbr`` 23 | - ``Vertex/scaled(by:)-20sq4`` 24 | - ``Vertex/translated(by:)`` 25 | - ``Vertex/transformed(by:)`` 26 | 27 | ### Interpolating Vertices 28 | 29 | - ``Vertex/lerp(_:_:)`` 30 | 31 | ### Encoding and Decoding Vertices 32 | 33 | - ``Vertex/encode(to:)`` 34 | - ``Vertex/init(from:)`` 35 | -------------------------------------------------------------------------------- /Euclid/Euclid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/Euclid/Euclid.png -------------------------------------------------------------------------------- /Euclid/Euclid.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Euclid", 3 | "version": "0.7.14", 4 | "license": { 5 | "type": "MIT", 6 | "file": "LICENSE.md" 7 | }, 8 | "summary": "Swift library for creating and manipulating 3D geometry", 9 | "homepage": "https://github.com/nicklockwood/Euclid", 10 | "authors": "Nick Lockwood", 11 | "source": { 12 | "git": "https://github.com/nicklockwood/Euclid.git", 13 | "tag": "0.7.14" 14 | }, 15 | "source_files": "Sources", 16 | "requires_arc": true, 17 | "platforms": { 18 | "ios": "11.0", 19 | "osx": "10.13", 20 | "tvos": "11.0" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Euclid/Euclid.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Euclid/Euclid.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Euclid/Example/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Example 4 | // 5 | // Created by Nick Lockwood on 11/12/2018. 6 | // Copyright © 2018 Nick Lockwood. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | var window: UIWindow? 14 | } 15 | -------------------------------------------------------------------------------- /Euclid/Example/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Euclid/Example/EuclidMesh.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EuclidMesh.swift 3 | // Example 4 | // 5 | // Created by Nick Lockwood on 20/09/2023. 6 | // Copyright © 2023 Nick Lockwood. All rights reserved. 7 | // 8 | 9 | import Euclid 10 | import UIKit 11 | 12 | let euclidMesh: Mesh = { 13 | let start = CFAbsoluteTimeGetCurrent() 14 | 15 | // create some geometry using Euclid 16 | let cube = Mesh.cube(size: 0.8, material: UIColor.red) 17 | let sphere = Mesh.sphere(slices: 120, material: CGImage.checkerboard()) 18 | let mesh = cube.subtracting(sphere).makeWatertight() 19 | 20 | print("Time:", CFAbsoluteTimeGetCurrent() - start) 21 | print("Polygons:", mesh.polygons.count) 22 | print("Triangles:", mesh.triangulate().polygons.count) 23 | print("Watertight:", mesh.isWatertight) 24 | 25 | return mesh 26 | }() 27 | -------------------------------------------------------------------------------- /Euclid/Example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UIStatusBarHidden 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Euclid/Example/SceneKitViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SceneKitViewController.swift 3 | // Example 4 | // 5 | // Created by Nick Lockwood on 11/12/2018. 6 | // Copyright © 2018 Nick Lockwood. All rights reserved. 7 | // 8 | 9 | import Euclid 10 | import SceneKit 11 | import UIKit 12 | 13 | class SceneKitViewController: UIViewController { 14 | override func viewDidLoad() { 15 | super.viewDidLoad() 16 | 17 | // create a new scene 18 | let scene = SCNScene() 19 | 20 | // create and add a camera to the scene 21 | let cameraNode = SCNNode() 22 | cameraNode.camera = SCNCamera() 23 | scene.rootNode.addChildNode(cameraNode) 24 | 25 | // place the camera 26 | cameraNode.position = SCNVector3(x: 0, y: 0, z: 2) 27 | 28 | // create SCNNode 29 | let geometry = SCNGeometry(euclidMesh) 30 | let node = SCNNode(geometry: geometry) 31 | scene.rootNode.addChildNode(node) 32 | 33 | // configure the SCNView 34 | let scnView = view as! SCNView 35 | scnView.scene = scene 36 | scnView.autoenablesDefaultLighting = true 37 | scnView.allowsCameraControl = true 38 | scnView.backgroundColor = .white 39 | } 40 | 41 | override var shouldAutorotate: Bool { 42 | true 43 | } 44 | 45 | override var prefersStatusBarHidden: Bool { 46 | true 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Euclid/LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Nick Lockwood 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Euclid/Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.1 2 | 3 | import PackageDescription 4 | 5 | let package = Package( 6 | name: "Euclid", 7 | products: [ 8 | .library(name: "Euclid", targets: ["Euclid"]), 9 | ], 10 | targets: [ 11 | .target( 12 | name: "Euclid", 13 | path: "Sources", 14 | exclude: ["Info.plist"] 15 | ), 16 | .testTarget( 17 | name: "EuclidTests", 18 | dependencies: ["Euclid"], 19 | path: "Tests", 20 | exclude: ["Info.plist"] 21 | ), 22 | ] 23 | ) 24 | -------------------------------------------------------------------------------- /Euclid/Package@swift-5.5.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.5 2 | 3 | import PackageDescription 4 | 5 | let package = Package( 6 | name: "Euclid", 7 | products: [ 8 | .library(name: "Euclid", targets: ["Euclid"]), 9 | ], 10 | targets: [ 11 | .target( 12 | name: "Euclid", 13 | path: "Sources", 14 | exclude: ["Info.plist"] 15 | ), 16 | .testTarget( 17 | name: "EuclidTests", 18 | dependencies: ["Euclid"], 19 | path: "Tests", 20 | exclude: ["Info.plist"] 21 | ), 22 | ] 23 | ) 24 | -------------------------------------------------------------------------------- /Euclid/Sources/Euclid.h: -------------------------------------------------------------------------------- 1 | // 2 | // Euclid.h 3 | // Euclid 4 | // 5 | // Created by Nick Lockwood on 11/12/2018. 6 | // Copyright © 2018 Nick Lockwood. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for Euclid. 12 | FOUNDATION_EXPORT double EuclidVersionNumber; 13 | 14 | //! Project version string for Euclid. 15 | FOUNDATION_EXPORT const unsigned char EuclidVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /Euclid/Sources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | $(MARKETING_VERSION) 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSHumanReadableCopyright 22 | Copyright © 2018 Nick Lockwood. All rights reserved. 23 | 24 | 25 | -------------------------------------------------------------------------------- /Euclid/Tests/Cube.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/Euclid/Tests/Cube.stl -------------------------------------------------------------------------------- /Euclid/Tests/Euclid+Testing.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Euclid+Testing.swift 3 | // EuclidTests 4 | // 5 | // Created by Nick Lockwood on 13/06/2022. 6 | // Copyright © 2022 Nick Lockwood. All rights reserved. 7 | // 8 | 9 | @testable import Euclid 10 | import XCTest 11 | 12 | func XCTAssertEqual( 13 | _ v1: @autoclosure () throws -> Vector, 14 | _ v2: @autoclosure () throws -> Vector, 15 | accuracy: Double = epsilon, 16 | _ message: @autoclosure () -> String = "", 17 | file: StaticString = #file, 18 | line: UInt = #line 19 | ) { 20 | do { 21 | let v1 = try v1(), v2 = try v2() 22 | if !v1.isEqual(to: v2, withPrecision: accuracy) { 23 | var m = message() 24 | if m.isEmpty { 25 | m = "\(v1) is not equal to \(v2) +/1 \(accuracy)" 26 | } 27 | XCTFail(m, file: file, line: line) 28 | } 29 | } catch { 30 | XCTFail(error.localizedDescription) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Euclid/Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Euclid/Tests/StretchableTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StretchableTests.swift 3 | // EuclidTests 4 | // 5 | // Created by Nick Lockwood on 21/11/2022. 6 | // Copyright © 2022 Nick Lockwood. All rights reserved. 7 | // 8 | 9 | @testable import Euclid 10 | import XCTest 11 | 12 | private extension Stretchable { 13 | func stretched(by scaleFactor: Double, along: Vector) -> Self { 14 | assert(along.isNormalized) 15 | return stretched(by: scaleFactor, along: Line( 16 | unchecked: .zero, 17 | direction: along.normalized() 18 | )) 19 | } 20 | } 21 | 22 | class StretchableTests: XCTestCase { 23 | // MARK: Rotation 24 | 25 | func testStretchPoint() { 26 | let p = Vector(1, 1) 27 | let q = p.stretched(by: 1.5, along: .unitY) 28 | XCTAssertEqual(q, Vector(1, 1.5)) 29 | let r = p.stretched(by: 1.5, along: -.unitY) 30 | XCTAssertEqual(r, Vector(1, 1.5)) 31 | let s = p.stretched(by: 1.5, along: .unitX) 32 | XCTAssertEqual(s, Vector(1.5, 1)) 33 | let t = p.stretched(by: 1.5, along: -.unitX) 34 | XCTAssertEqual(t, Vector(1.5, 1)) 35 | } 36 | 37 | func testStretchPath() { 38 | let p = Path.circle() 39 | let q = p.stretched(by: 1.5, along: .unitY) 40 | XCTAssert(q.isEqual(to: p.scaled(by: Vector(1, 1.5, 1)))) 41 | let r = p.stretched(by: 1.5, along: .unitX) 42 | XCTAssert(r.isEqual(to: p.scaled(by: Vector(1.5, 1, 1)))) 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Euclid/Tests/TextTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TextTests.swift 3 | // EuclidTests 4 | // 5 | // Created by Nick Lockwood on 12/03/2019. 6 | // Copyright © 2019 Nick Lockwood. All rights reserved. 7 | // 8 | 9 | #if canImport(CoreText) 10 | 11 | import CoreText 12 | @testable import Euclid 13 | import Foundation 14 | import XCTest 15 | 16 | class TextTests: XCTestCase { 17 | func testTextPaths() { 18 | let text = NSAttributedString(string: "Hello") 19 | let paths = Path.text(text) 20 | XCTAssertEqual(paths.count, 5) 21 | XCTAssertEqual(paths.map { $0.subpaths.count }, [ 22 | 1, 2, 1, 1, 2, 23 | ]) 24 | } 25 | 26 | func testTextMeshWithAttributedString() { 27 | let text = "Hello" 28 | let font = CTFontCreateWithName("Helvetica" as CFString, 12, nil) 29 | let attributes = [NSAttributedString.Key.font: font] 30 | let string = NSAttributedString(string: text, attributes: attributes) 31 | let mesh = Mesh.text(string, depth: 1.0) 32 | XCTAssertEqual(mesh.bounds.min.z, -0.5) 33 | XCTAssertEqual(mesh.bounds.max.z, 0.5) 34 | XCTAssert(mesh.bounds.max.x > 20) 35 | XCTAssert(mesh.polygons.count > 150) 36 | } 37 | 38 | func testTextMeshWithString() { 39 | let text = "Hello" 40 | let font = CTFontCreateWithName("Helvetica" as CFString, 12, nil) 41 | let mesh = Mesh.text(text, font: font, depth: 1.0) 42 | XCTAssertEqual(mesh.bounds.min.z, -0.5) 43 | XCTAssertEqual(mesh.bounds.max.z, 0.5) 44 | XCTAssert(mesh.bounds.max.x > 20) 45 | XCTAssert(mesh.polygons.count > 150) 46 | } 47 | } 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /Examples/Ball.shape: -------------------------------------------------------------------------------- 1 | // ShapeScript document 2 | 3 | detail 32 4 | 5 | stencil { 6 | // ball 7 | sphere { 8 | color 1 1 0 9 | } 10 | // stripe 11 | cube { 12 | color 0 0 1 13 | size 1 1 0.4 14 | } 15 | // star 16 | extrude { 17 | color 1 0 0 18 | size 0.3 0.3 1 19 | path { 20 | for 1 to 5 { 21 | point 0 -0.5 22 | rotate 1 / 5 23 | point 0 -1 24 | rotate 1 / 5 25 | } 26 | point 0 -0.5 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Examples/Cog.shape: -------------------------------------------------------------------------------- 1 | // ShapeScript document 2 | 3 | define cog { 4 | option teeth 6 5 | path { 6 | define step 1 / teeth 7 | for 1 to teeth { 8 | point -0.02 0.8 9 | point 0.05 1 10 | rotate step 11 | point -0.05 1 12 | point 0.02 0.8 13 | rotate step 14 | } 15 | point -0.02 0.8 16 | } 17 | } 18 | 19 | difference { 20 | extrude { 21 | size 1 1 0.5 22 | cog { teeth 8 } 23 | } 24 | rotate 0 0 0.5 25 | cylinder 26 | } 27 | -------------------------------------------------------------------------------- /Examples/Earth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/Examples/Earth.png -------------------------------------------------------------------------------- /Examples/Earth.shape: -------------------------------------------------------------------------------- 1 | // ShapeScript document 2 | 3 | detail 64 4 | 5 | background "Stars.jpg" 6 | 7 | texture "Earth.png" 8 | sphere 9 | -------------------------------------------------------------------------------- /Examples/Spirals.shape: -------------------------------------------------------------------------------- 1 | // ShapeScript document 2 | 3 | detail 32 4 | 5 | define spiral { 6 | option coils 3 // number of coils 7 | option radius 0.5 // radius of coil 8 | option steps detail * coils // number of segments 9 | 10 | path { 11 | detail 0 12 | for i in 0 to steps - 1 { 13 | curve 0 radius * (1 - i / steps) 0 14 | rotate 2 / steps * coils 15 | } 16 | } 17 | } 18 | 19 | // spiral path 20 | spiral { coils 3 } 21 | 22 | // extruded spiral 23 | extrude { 24 | position 1 25 | size 1 1 0.1 26 | spiral { coils 4 } 27 | } 28 | 29 | // solid spiral with circular cross-section 30 | extrude { 31 | position 2 32 | circle { size 0.03 } 33 | along spiral { coils 5 } 34 | } 35 | -------------------------------------------------------------------------------- /Examples/Spring.shape: -------------------------------------------------------------------------------- 1 | // ShapeScript document 2 | 3 | detail 32 4 | 5 | define spring { 6 | option coils 2 // number of coils 7 | option spacing 0.3 // spacing between coils 8 | option thickness 0.2 // thickness of spring 9 | option radius 0.5 // radius of coil 10 | loft { 11 | translate 0 -spacing * coils / 2 12 | for 0 to detail * coils { 13 | rotate 0 1/detail 0 14 | translate radius 15 | circle { size thickness/2 } 16 | translate -radius 17 | rotate 0 1/detail 0 18 | translate 0 spacing/detail 19 | } 20 | } 21 | } 22 | 23 | spring { 24 | coils 4 25 | } 26 | -------------------------------------------------------------------------------- /Examples/Stars.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/Examples/Stars.jpg -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Nick Lockwood 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /LRUCache/.swift-version: -------------------------------------------------------------------------------- 1 | 5.1 -------------------------------------------------------------------------------- /LRUCache/.swiftformat: -------------------------------------------------------------------------------- 1 | --hexgrouping ignore 2 | --decimalgrouping ignore 3 | --enable isEmpty 4 | --ifdef no-indent 5 | --self init-only 6 | --wraparguments before-first 7 | --wrapcollections before-first 8 | --maxwidth 80 9 | 10 | --exclude Package.swift -------------------------------------------------------------------------------- /LRUCache/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [1.0.7](https://github.com/nicklockwood/LRUCache/releases/tag/1.0.7) (2024-01-26) 2 | 3 | - Fixed watchOS compatibility issue 4 | 5 | ## [1.0.6](https://github.com/nicklockwood/LRUCache/releases/tag/1.0.6) (2024-01-22) 6 | 7 | - Fixed bug where `totalCost` wasn't reset when calling `removeAllValues()` 8 | - Automatic cache clearing in the event of a memory warning now works on visionOS 9 | 10 | ## [1.0.5](https://github.com/nicklockwood/LRUCache/releases/tag/1.0.5) (2024-01-20) 11 | 12 | - Added `allKeys` computed property 13 | 14 | ## [1.0.4](https://github.com/nicklockwood/LRUCache/releases/tag/1.0.4) (2022-09-16) 15 | 16 | - Added `allValues` computed property 17 | - Added watchOS compatibility 18 | - Fixed warnings on Xcode 14 19 | 20 | ## [1.0.3](https://github.com/nicklockwood/LRUCache/releases/tag/1.0.3) (2021-08-08) 21 | 22 | - Fixed warnings on Xcode 13.3 23 | 24 | ## [1.0.2](https://github.com/nicklockwood/LRUCache/releases/tag/1.0.2) (2021-08-08) 25 | 26 | - Significantly improved performance when cache is full by using a double-linked list 27 | 28 | ## [1.0.1](https://github.com/nicklockwood/LRUCache/releases/tag/1.0.1) (2021-08-06) 29 | 30 | - Fixed a small memory leak on iOS, where `NSNotification` observers weren't released 31 | - Added `LRUCacheMemoryWarningNotification` for simpler cross-platform testing 32 | 33 | ## [1.0.0](https://github.com/nicklockwood/LRUCache/releases/tag/1.0.0) (2021-08-05) 34 | 35 | - First release 36 | -------------------------------------------------------------------------------- /LRUCache/LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Nick Lockwood 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /LRUCache/LRUCache.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /LRUCache/LRUCache.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /LRUCache/Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.1 2 | import PackageDescription 3 | 4 | let package = Package( 5 | name: "LRUCache", 6 | products: [ 7 | .library(name: "LRUCache", targets: ["LRUCache"]), 8 | ], 9 | targets: [ 10 | .target(name: "LRUCache", path: "Sources"), 11 | .testTarget(name: "LRUCacheTests", dependencies: ["LRUCache"], path: "Tests"), 12 | ] 13 | ) 14 | -------------------------------------------------------------------------------- /LRUCache/Sources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | $(MARKETING_VERSION) 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSHumanReadableCopyright 22 | Copyright © 2021 Nick Lockwood. All rights reserved. 23 | 24 | 25 | -------------------------------------------------------------------------------- /LRUCache/Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /LRUCache/Tests/LRUPerformanceTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LRUPerformanceTests.swift 3 | // LRUCacheTests 4 | // 5 | // Created by Nick Lockwood on 05/08/2021. 6 | // Copyright © 2021 Nick Lockwood. All rights reserved. 7 | // 8 | 9 | import LRUCache 10 | import XCTest 11 | 12 | class LRUPerformanceTests: XCTestCase { 13 | let iterations = 10000 14 | 15 | func testInsertionPerformance() { 16 | measure { 17 | let cache = LRUCache() 18 | for i in 0 ..< iterations { 19 | cache.setValue(i, forKey: i) 20 | } 21 | } 22 | } 23 | 24 | func testLookupPerformance() { 25 | let cache = LRUCache() 26 | for i in 0 ..< iterations { 27 | cache.setValue(i, forKey: i) 28 | } 29 | measure { 30 | for i in 0 ..< iterations { 31 | _ = cache.value(forKey: i) 32 | } 33 | } 34 | } 35 | 36 | func testRemovalPerformance() { 37 | let cache = LRUCache() 38 | for i in 0 ..< iterations { 39 | cache.setValue(i, forKey: i) 40 | } 41 | measure { 42 | for i in 0 ..< iterations { 43 | _ = cache.removeValue(forKey: i) 44 | } 45 | } 46 | } 47 | 48 | func testOverflowInsertionPerformance() { 49 | measure { 50 | let cache = LRUCache(countLimit: 1000) 51 | for i in 0 ..< iterations { 52 | cache.setValue(i, forKey: i) 53 | } 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.1 2 | import PackageDescription 3 | 4 | let package = Package( 5 | name: "ShapeScript", 6 | platforms: [ 7 | .macOS(.v10_14), 8 | .iOS(.v11), 9 | .tvOS(.v11), 10 | ], 11 | products: [ 12 | .library(name: "ShapeScript", targets: ["ShapeScript"]), 13 | .executable(name: "shapescript", targets: ["CLI"]), 14 | ], 15 | dependencies: [ 16 | .package( 17 | url: "https://github.com/nicklockwood/Euclid.git", 18 | .upToNextMinor(from: "0.7.7") 19 | ), 20 | .package( 21 | url: "https://github.com/nicklockwood/LRUCache.git", 22 | .upToNextMinor(from: "1.0.6") 23 | ), 24 | .package( 25 | url: "https://github.com/nicklockwood/SVGPath.git", 26 | .upToNextMinor(from: "1.1.5") 27 | ), 28 | ], 29 | targets: [ 30 | .target( 31 | name: "ShapeScript", 32 | dependencies: ["Euclid", "LRUCache", "SVGPath"], 33 | path: "ShapeScript" 34 | ), 35 | .target( 36 | name: "CLI", 37 | dependencies: ["ShapeScript"], 38 | path: "Viewer/CLI" 39 | ), 40 | .testTarget( 41 | name: "ShapeScriptTests", 42 | dependencies: ["ShapeScript"], 43 | path: "ShapeScriptTests" 44 | ), 45 | ] 46 | ) 47 | -------------------------------------------------------------------------------- /SVGPath/.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | html/ 7 | .build 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.dot 23 | -------------------------------------------------------------------------------- /SVGPath/.swift-version: -------------------------------------------------------------------------------- 1 | 5.1 -------------------------------------------------------------------------------- /SVGPath/.swiftformat: -------------------------------------------------------------------------------- 1 | --hexgrouping ignore 2 | --decimalgrouping ignore 3 | --enable isEmpty 4 | --ifdef no-indent 5 | --self init-only 6 | --wraparguments before-first 7 | --wrapcollections before-first 8 | --maxwidth 80 9 | 10 | --exclude Package.swift -------------------------------------------------------------------------------- /SVGPath/LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Nick Lockwood 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /SVGPath/Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.1 2 | import PackageDescription 3 | 4 | let package = Package( 5 | name: "SVGPath", 6 | products: [ 7 | .library(name: "SVGPath", targets: ["SVGPath"]), 8 | ], 9 | targets: [ 10 | .target(name: "SVGPath", path: "Sources"), 11 | .testTarget(name: "SVGPathTests", dependencies: ["SVGPath"], path: "Tests"), 12 | ] 13 | ) 14 | -------------------------------------------------------------------------------- /SVGPath/Sources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | $(MARKETING_VERSION) 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSHumanReadableCopyright 22 | Copyright © 2021 Nick Lockwood. All rights reserved. 23 | 24 | 25 | -------------------------------------------------------------------------------- /SVGPath/Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /ShapeScript.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ShapeScript", 3 | "version": "1.8.10", 4 | "license": { 5 | "type": "MIT", 6 | "file": "LICENSE.md" 7 | }, 8 | "summary": "Scripting language for creating and manipulating 3D geometry", 9 | "homepage": "https://github.com/nicklockwood/ShapeScript", 10 | "authors": "Nick Lockwood", 11 | "source": { 12 | "git": "https://github.com/nicklockwood/ShapeScript.git", 13 | "tag": "1.8.10" 14 | }, 15 | "source_files": ["ShapeScript", "LRUCache/Sources", "SVGPath/Sources"], 16 | "requires_arc": true, 17 | "dependencies": { 18 | "Euclid": [ 19 | 20 | ] 21 | }, 22 | "platforms": { 23 | "ios": "11.0", 24 | "osx": "10.13", 25 | "tvos": "11.0" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ShapeScript.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ShapeScript.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ShapeScript/EvaluationDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EvaluationDelegate.swift 3 | // ShapeScript Lib 4 | // 5 | // Created by Nick Lockwood on 29/12/2023. 6 | // Copyright © 2023 Nick Lockwood. All rights reserved. 7 | // 8 | 9 | import Euclid 10 | import Foundation 11 | 12 | public protocol EvaluationDelegate: AnyObject { 13 | func resolveURL(for path: String) -> URL 14 | func importGeometry(for url: URL) throws -> Geometry? 15 | func debugLog(_ values: [AnyHashable]) 16 | } 17 | 18 | public extension EvaluationDelegate { 19 | func importGeometry(for _: URL) throws -> Geometry? { nil } 20 | } 21 | -------------------------------------------------------------------------------- /ShapeScript/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | $(MARKETING_VERSION) 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSHumanReadableCopyright 22 | Copyright © 2018 Nick Lockwood. All rights reserved. 23 | 24 | 25 | -------------------------------------------------------------------------------- /ShapeScript/RandomSequence.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RandomSequence.swift 3 | // ShapeScript 4 | // 5 | // Created by Nick Lockwood on 07/11/2018. 6 | // Copyright © 2018 Nick Lockwood. All rights reserved. 7 | // 8 | 9 | private extension Double { 10 | static let modulus: Double = .init(UInt32.max) + 1 11 | static let multiplier: Double = 1664525 12 | static let increment: Double = 1013904223 13 | } 14 | 15 | final class RandomSequence { 16 | var seed: Double { 17 | didSet { 18 | seed = seed.truncatingRemainder(dividingBy: .modulus) 19 | } 20 | } 21 | 22 | // create sequence with specific seed 23 | init(seed: Double) { 24 | self.seed = seed.truncatingRemainder(dividingBy: .modulus) 25 | } 26 | 27 | // compute next seed and return value as double in range 0.0 ..< 1.0 28 | func next() -> Double { 29 | seed = seed * .multiplier + .increment 30 | return seed / .modulus 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ShapeScriptTests/EdgeOfTheGalaxyRegular-OVEa6.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/ShapeScriptTests/EdgeOfTheGalaxyRegular-OVEa6.otf -------------------------------------------------------------------------------- /ShapeScriptTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /ShapeScriptTests/PlatformTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PlatformTests.swift 3 | // ShapeScriptTests 4 | // 5 | // Created by Nick Lockwood on 07/05/2022. 6 | // Copyright © 2022 Nick Lockwood. All rights reserved. 7 | // 8 | 9 | @testable import ShapeScript 10 | import XCTest 11 | 12 | #if canImport(UIKit) || canImport(AppKit) 13 | 14 | class PlatformTests: XCTestCase { 15 | // MARK: Texture conversion 16 | 17 | func testTextureToImage() throws { 18 | let file = testsDirectory.appendingPathComponent("Stars1.jpg") 19 | let input = try XCTUnwrap(OSImage(contentsOfFile: file.path)) 20 | let texture = try XCTUnwrap(Texture(input, intensity: 1)) 21 | let output = try XCTUnwrap(OSImage(texture)) 22 | XCTAssertEqual(input.size, output.size) 23 | } 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /ShapeScriptTests/SVGPathTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SVGPathTests.swift 3 | // ShapeScriptTests 4 | // 5 | // Created by Nick Lockwood on 18/02/2024. 6 | // Copyright © 2024 Nick Lockwood. All rights reserved. 7 | // 8 | 9 | import Euclid 10 | import ShapeScript 11 | import SVGPath 12 | import XCTest 13 | 14 | class SVGPathTests: XCTestCase { 15 | func testNoCrashWithEmptyPath() { 16 | XCTAssertEqual(SVGPath(Path.empty), SVGPath(commands: [])) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ShapeScriptTests/Stars1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/ShapeScriptTests/Stars1.jpg -------------------------------------------------------------------------------- /ShapeScriptTests/StringMatchingTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StringMatchingTests.swift 3 | // ShapeScriptTests 4 | // 5 | // Created by Nick Lockwood on 16/04/2022. 6 | // Copyright © 2022 Nick Lockwood. All rights reserved. 7 | // 8 | 9 | @testable import ShapeScript 10 | import XCTest 11 | 12 | class StringMatchingTests: XCTestCase { 13 | // MARK: Edit distance 14 | 15 | func testEditDistance() { 16 | XCTAssertEqual("foo".editDistance(from: "fob"), 1) 17 | XCTAssertEqual("foo".editDistance(from: "boo"), 1) 18 | XCTAssertEqual("foo".editDistance(from: "bar"), 3) 19 | XCTAssertEqual("aba".editDistance(from: "bbb"), 2) 20 | XCTAssertEqual("foob".editDistance(from: "foo"), 1) 21 | XCTAssertEqual("foo".editDistance(from: "foob"), 1) 22 | XCTAssertEqual("foo".editDistance(from: "Foo"), 1) 23 | XCTAssertEqual("FOO".editDistance(from: "foo"), 3) 24 | } 25 | 26 | func testEditDistanceWithEmptyStrings() { 27 | XCTAssertEqual("foo".editDistance(from: ""), 3) 28 | XCTAssertEqual("".editDistance(from: "foo"), 3) 29 | XCTAssertEqual("".editDistance(from: ""), 0) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ShapeScriptTests/TestDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TestDelegate.swift 3 | // ShapeScriptTests 4 | // 5 | // Created by Nick Lockwood on 03/06/2022. 6 | // Copyright © 2022 Nick Lockwood. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import ShapeScript 11 | 12 | let testsDirectory = URL(fileURLWithPath: #file).deletingLastPathComponent() 13 | 14 | class TestDelegate: EvaluationDelegate { 15 | let directory: URL 16 | init(directory: URL = testsDirectory) { 17 | self.directory = directory 18 | } 19 | 20 | var imports = [String]() 21 | func resolveURL(for name: String) -> URL { 22 | imports.append(name) 23 | return directory.appendingPathComponent(name) 24 | } 25 | 26 | var log = [AnyHashable?]() 27 | func debugLog(_ values: [AnyHashable]) { 28 | log += values 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ShapeScriptTests/TestShapes/CracksTest-mac.shape: -------------------------------------------------------------------------------- 1 | // Tends to crack with low epsilon 2 | 3 | detail 80 4 | 5 | difference { 6 | // outer 7 | cylinder { 8 | size 10.6 9 9 | } 10 | 11 | // inner 12 | cylinder { 13 | size 9.8 8.5 14 | position 0 0.5 15 | } 16 | 17 | // tip 18 | difference { 19 | cylinder { 20 | size 10.6 9 21 | } 22 | cone { 23 | size 30 20 24 | orientation -1 25 | position 0 -1 26 | } 27 | } 28 | } 29 | 30 | 31 | // Tends to crack with high epsilon 32 | 33 | font "comic sans ms" 34 | 35 | //scale 0.0001 36 | 37 | detail 16 38 | opacity 1 39 | difference { 40 | extrude { 41 | text { 42 | "Hello" 43 | "World!" 44 | } 45 | along circle { size 1 } 46 | } 47 | translate 6 48 | cube { size 12 } 49 | } 50 | -------------------------------------------------------------------------------- /ShapeScriptTests/TestShapes/CracksTest2.shape: -------------------------------------------------------------------------------- 1 | // ShapeScript document 2 | 3 | detail 80 4 | 5 | rotate 0 1 6 | difference { 7 | extrude { 8 | circle { 9 | size 0.025 10 | } 11 | color green 12 | along circle { 13 | position 0 0 (0.49) * 1.07 14 | size 0.08 15 | } 16 | } 17 | 18 | sphere { 19 | size 1.06 20 | color black 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ShapeScriptTests/TestShapes/CracksTest3.shape: -------------------------------------------------------------------------------- 1 | // ShapeScript document 2 | 3 | detail 190 4 | 5 | define RADIUSBOTTOM 94 6 | define RADIUSTOP 104.8 7 | define HEIGHT 64 8 | define DEPTH (HEIGHT / 2) 9 | define THICKNESS (RADIUSBOTTOM / 10) 10 | define WALLTHICKNESS 1 11 | define DIAMETER (THICKNESS * (pi / 2) - WALLTHICKNESS * 2) 12 | 13 | difference { 14 | lathe path { 15 | point 0 HEIGHT 16 | point (RADIUSTOP / 2 + THICKNESS) HEIGHT 17 | point (RADIUSBOTTOM / 2 + THICKNESS) 0 18 | point 0 0 19 | } 20 | 21 | cube { 22 | size (RADIUSTOP + THICKNESS * 2 + WALLTHICKNESS) (HEIGHT - DEPTH) (RADIUSTOP + THICKNESS * 2 + WALLTHICKNESS) 23 | position 0 ((HEIGHT + DIAMETER) - ((HEIGHT - DEPTH) / 2)) 24 | } 25 | 26 | cone { 27 | orientation 1 28 | size (RADIUSTOP + THICKNESS * 2 + WALLTHICKNESS * 2) (THICKNESS * 2) 29 | position 0 (HEIGHT / 2 + THICKNESS / 2) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ShapeScriptTests/TestShapes/CracksTest4.shape: -------------------------------------------------------------------------------- 1 | // ShapeScript document 2 | 3 | detail 190 4 | 5 | define RADIUSBOTTOM 94 6 | define RADIUSTOP 104.8 7 | define HEIGHT 64 8 | define DEPTH (HEIGHT / 2) 9 | define THICKNESS (RADIUSBOTTOM / 10) 10 | define WALLTHICKNESS 1 11 | define DIAMETER (THICKNESS * (pi / 2) - WALLTHICKNESS * 2) 12 | 13 | difference { 14 | union { 15 | lathe path { 16 | point 0 (HEIGHT - WALLTHICKNESS) 17 | point (RADIUSTOP / 2 + WALLTHICKNESS / 1.67) (HEIGHT - WALLTHICKNESS) 18 | point (RADIUSBOTTOM / 2 + WALLTHICKNESS / 1.67) WALLTHICKNESS + (DIAMETER / 2) 19 | point 0 WALLTHICKNESS + (DIAMETER / 2) 20 | } 21 | 22 | /// Put angle into the inner chamber to prevent final layers from sagging 23 | cone { 24 | orientation 1 25 | size (RADIUSTOP + THICKNESS * 2 + WALLTHICKNESS * 2) (THICKNESS * 2) 26 | position 0 (HEIGHT / 2 + THICKNESS / 2 - WALLTHICKNESS) 27 | } 28 | } 29 | 30 | /// Cut off the top 31 | cube { 32 | size (RADIUSTOP + THICKNESS * 3) (HEIGHT - DEPTH) (RADIUSTOP + THICKNESS * 3) 33 | position 0 ((HEIGHT + DIAMETER) - ((HEIGHT - DEPTH) / 2) - WALLTHICKNESS) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /ShapeScriptTests/TestShapes/CrashTest.shape: -------------------------------------------------------------------------------- 1 | // ShapeScript document 2 | 3 | define myPath { 4 | path { 5 | point -3/2 1/2 6 | arc 7 | point -3/2 -1/2 8 | point -3/2 1/2 9 | } 10 | } 11 | group { 12 | color green 13 | myPath 14 | translate 3 15 | extrude myPath 16 | } 17 | -------------------------------------------------------------------------------- /Viewer/CLI/CLI+Export.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CLI+Export.swift 3 | // ShapeScript Lib 4 | // 5 | // Created by Nick Lockwood on 07/05/2023. 6 | // Copyright © 2023 Nick Lockwood. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import ShapeScript 11 | 12 | struct ExportOptions { 13 | var convertToZUp: Bool 14 | } 15 | 16 | extension ExportOptions { 17 | static let arguments: [(name: String, help: String)] = [ 18 | ("z-up", "Output model using Z as up axis instead of Y"), 19 | ] 20 | 21 | init(arguments: [String: String]) throws { 22 | self.convertToZUp = try arguments["z-up"].map { 23 | guard $0 == "" else { 24 | throw CLIError("--z-up option does not expect a value") 25 | } 26 | return true 27 | } ?? false 28 | } 29 | } 30 | 31 | extension CLI { 32 | static let exportTypes: [String] = ["stl", "stla"] 33 | 34 | func export(_ geometry: Geometry, to url: URL, with options: ExportOptions) throws { 35 | var mesh = geometry.merged() 36 | if options.convertToZUp { 37 | mesh.rotate(by: .pitch(.degrees(-90))) 38 | } 39 | switch url.pathExtension.lowercased() { 40 | case "stl": 41 | let stl = mesh.stlData(colorLookup: { ($0 as? Material)?.color }) 42 | try stl.write(to: url, options: .atomic) 43 | case "stla": 44 | let name = geometry.name ?? url.deletingPathExtension().lastPathComponent 45 | let stl = mesh.stlString(name: name) 46 | try stl.write(to: url, atomically: true, encoding: .utf8) 47 | case let ext: 48 | throw CLIError("Unsupported export file type '\(ext)'") 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Viewer/CLI/Geometry+ModelInfo.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Geometry+ModelInfo.swift 3 | // Viewer 4 | // 5 | // Created by Nick Lockwood on 21/01/2022. 6 | // Copyright © 2022 Nick Lockwood. All rights reserved. 7 | // 8 | 9 | import ShapeScript 10 | 11 | extension Geometry { 12 | var modelInfo: String { 13 | let polygons = String(polygons { false }.count) 14 | let triangles = String(triangles { false }.count) 15 | let dimensions = exactBounds(with: worldTransform).size.logDescription 16 | let watertight = isWatertight { false }.logDescription 17 | 18 | return [ 19 | "Objects: \(objectCount)", 20 | triangles == polygons ? nil : "Polygons: \(polygons)", 21 | hasMesh ? "Triangles: \(triangles)" : nil, 22 | bounds.isEmpty ? nil : "Dimensions: \(dimensions)", 23 | hasMesh ? "Watertight: \(watertight)" : nil, 24 | ].compactMap { $0 }.joined(separator: "\n") 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Viewer/CLI/ProgramError+Formatting.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ProgramError+Formatting.swift 3 | // ShapeScript Viewer 4 | // 5 | // Created by Nick Lockwood on 01/08/2021. 6 | // Copyright © 2021 Nick Lockwood. All rights reserved. 7 | // 8 | 9 | import ShapeScript 10 | 11 | extension ProgramError { 12 | /// Returns a nicely-formatted rich text error message. 13 | func message(with source: String) -> String { 14 | var errorMessage = "\(messageAndLocation(with: source))\n" 15 | if let line = annotatedErrorLine(with: source) { 16 | let indentedLines = line.split(separator: "\n").map { " \($0)" } 17 | errorMessage += "\n\(indentedLines.joined(separator: "\n"))\n" 18 | } 19 | if let hint = hint { 20 | errorMessage += "\n\(hint)\n" 21 | } 22 | return errorMessage 23 | } 24 | } 25 | 26 | private func numberOfEmoji(in string: S) -> Int { 27 | string.reduce(0) { count, c in 28 | let scalars = c.unicodeScalars 29 | if scalars.count > 1 || (scalars.first?.value ?? 0) > 0x238C { 30 | return count + 1 31 | } 32 | return count 33 | } 34 | } 35 | 36 | private func emojiSpacing(for string: S) -> Int { 37 | Int(Double(numberOfEmoji(in: string)) * 1.25) 38 | } 39 | -------------------------------------------------------------------------------- /Viewer/CLI/main.swift: -------------------------------------------------------------------------------- 1 | // 2 | // main.swift 3 | // CLI 4 | // 5 | // Created by Nick Lockwood on 31/08/2022. 6 | // Copyright © 2022 Nick Lockwood. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | let arguments = CommandLine.arguments 12 | let directory = FileManager.default.currentDirectoryPath 13 | 14 | do { 15 | let cli = try CLI(in: directory, with: arguments) 16 | try cli.run() 17 | exit(0) 18 | } catch { 19 | print(error.localizedDescription) 20 | exit(-1) 21 | } 22 | -------------------------------------------------------------------------------- /Viewer/Mac/Assets.xcassets/AppIcon.appiconset/1024-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/Viewer/Mac/Assets.xcassets/AppIcon.appiconset/1024-dark.png -------------------------------------------------------------------------------- /Viewer/Mac/Assets.xcassets/AppIcon.appiconset/128-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/Viewer/Mac/Assets.xcassets/AppIcon.appiconset/128-dark.png -------------------------------------------------------------------------------- /Viewer/Mac/Assets.xcassets/AppIcon.appiconset/16-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/Viewer/Mac/Assets.xcassets/AppIcon.appiconset/16-dark.png -------------------------------------------------------------------------------- /Viewer/Mac/Assets.xcassets/AppIcon.appiconset/256-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/Viewer/Mac/Assets.xcassets/AppIcon.appiconset/256-dark.png -------------------------------------------------------------------------------- /Viewer/Mac/Assets.xcassets/AppIcon.appiconset/32-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/Viewer/Mac/Assets.xcassets/AppIcon.appiconset/32-dark.png -------------------------------------------------------------------------------- /Viewer/Mac/Assets.xcassets/AppIcon.appiconset/512-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/Viewer/Mac/Assets.xcassets/AppIcon.appiconset/512-dark.png -------------------------------------------------------------------------------- /Viewer/Mac/Assets.xcassets/AppIcon.appiconset/64-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/Viewer/Mac/Assets.xcassets/AppIcon.appiconset/64-dark.png -------------------------------------------------------------------------------- /Viewer/Mac/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "filename" : "16-dark.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "idiom" : "mac", 11 | "size" : "16x16", 12 | "filename" : "32-dark.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "idiom" : "mac", 17 | "size" : "32x32", 18 | "filename" : "32-dark.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "idiom" : "mac", 23 | "size" : "32x32", 24 | "filename" : "64-dark.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "idiom" : "mac", 29 | "size" : "128x128", 30 | "filename" : "128-dark.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "128x128", 36 | "filename" : "256-dark.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "idiom" : "mac", 41 | "size" : "256x256", 42 | "filename" : "256-dark.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "512-dark.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "512-dark.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "1024-dark.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /Viewer/Mac/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Viewer/Mac/LicensesViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LicensesViewController.swift 3 | // ShapeScript App 4 | // 5 | // Created by Nick Lockwood on 27/04/2022. 6 | // Copyright © 2022 Nick Lockwood. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class LicensesViewController: NSViewController { 12 | @IBOutlet private var textView: NSTextView! 13 | 14 | override func viewDidLoad() { 15 | super.viewDidLoad() 16 | textView.textStorage?.setAttributedString(loadRTF("Licenses")) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Viewer/Mac/PreferencesViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PreferencesViewController.swift 3 | // Viewer 4 | // 5 | // Created by Nick Lockwood on 21/12/2018. 6 | // Copyright © 2018 Nick Lockwood. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class PreferencesViewController: NSViewController { 12 | @IBOutlet var editorPopUp: NSPopUpButton! 13 | 14 | override func viewDidLoad() { 15 | super.viewDidLoad() 16 | configureEditorPopup(editorPopUp) 17 | } 18 | 19 | override func viewWillAppear() { 20 | super.viewWillAppear() 21 | configureEditorPopup(editorPopUp) 22 | } 23 | 24 | // MARK: Editor 25 | 26 | @IBAction func didSelectEditor(_ sender: NSPopUpButton) { 27 | handleEditorPopupAction(for: sender, in: view.window) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Viewer/Mac/Viewer.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.files.user-selected.read-write 8 | 9 | com.apple.security.files.bookmarks.app-scope 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Viewer/Mac/Welcome.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg1252\cocoartf2638 2 | \cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fnil\fcharset0 HelveticaNeue;} 3 | {\colortbl;\red255\green255\blue255;\red0\green0\blue0;} 4 | {\*\expandedcolortbl;;\cssrgb\c0\c0\c0\cname textColor;} 5 | \paperw11900\paperh16840\margl1440\margr1440\vieww15100\viewh13360\viewkind0 6 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\partightenfactor0 7 | 8 | \f0\fs28 \cf2 ShapeScript is a text-based 3D modeling tool. If this is your first time using ShapeScript, we recommend you check out the Getting Started guide.\expnd0\expndtw0\kerning0 9 | \ 10 | \pard\pardeftab720\partightenfactor0 11 | \cf2 \ 12 | This viewer is free to use for creating and previewing models in ShapeScript's own shape file format.\ 13 | \ 14 | The commercial release of ShapeScript (which you can find on the {\field{\*\fldinst{HYPERLINK "https://apps.apple.com/app/id1441135869"}}{\fldrslt Mac App Store}}) includes a one-time in-app purchase to unlock the ability to export ShapeScript models in various formats, for use with other applications.} -------------------------------------------------------------------------------- /Viewer/Mac/WelcomeViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WelcomeViewController.swift 3 | // Viewer 4 | // 5 | // Created by Nick Lockwood on 02/11/2018. 6 | // Copyright © 2018 Nick Lockwood. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class WelcomeViewController: NSViewController { 12 | @IBOutlet private var welcomeView: NSTextView! 13 | @IBOutlet private var shouldShowAtStartupCheckbox: NSButton! 14 | 15 | override func viewDidLoad() { 16 | super.viewDidLoad() 17 | welcomeView.textStorage?.setAttributedString(loadRTF("Welcome")) 18 | shouldShowAtStartupCheckbox.state = 19 | WelcomeViewController.shouldShowAtStartup ? .on : .off 20 | } 21 | 22 | @IBAction func openGettingStartedGuide(_: Any) { 23 | NSWorkspace.shared.open(onlineHelpURL.appendingPathComponent("getting-started")) 24 | } 25 | 26 | @IBAction func toggleShowAtStartup(_ sender: NSButton) { 27 | WelcomeViewController.shouldShowAtStartup = (sender.state == .on) 28 | } 29 | 30 | public static var shouldShowAtStartup: Bool { 31 | get { Settings.shared.showWelcomeScreenAtStartup } 32 | set { Settings.shared.showWelcomeScreenAtStartup = newValue } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Viewer/Mac/WhatsNewViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WhatsNewViewController.swift 3 | // ShapeScript App 4 | // 5 | // Created by Nick Lockwood on 27/04/2022. 6 | // Copyright © 2022 Nick Lockwood. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class WhatsNewViewController: NSViewController { 12 | @IBOutlet private var whatsNewView: NSTextView! 13 | 14 | override func viewDidLoad() { 15 | super.viewDidLoad() 16 | whatsNewView.textStorage?.setAttributedString(loadRTF("WhatsNew")) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Viewer/Mac/WindowController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WindowController.swift 3 | // ShapeScript Viewer 4 | // 5 | // Created by Nick Lockwood on 19/10/2021. 6 | // Copyright © 2021 Nick Lockwood. All rights reserved. 7 | // 8 | 9 | import AppKit 10 | 11 | class WindowController: NSWindowController { 12 | override func newWindowForTab(_ sender: Any?) { 13 | NSDocumentController.shared.openDocument(sender) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Viewer/Shared/Untitled.shape: -------------------------------------------------------------------------------- 1 | // ShapeScript document 2 | 3 | detail 32 4 | 5 | cube { 6 | position -1.5 7 | color 1 0 0 8 | } 9 | 10 | sphere { 11 | color 0 1 0 12 | } 13 | 14 | cone { 15 | position 1.5 16 | color 0 0 1 17 | } 18 | -------------------------------------------------------------------------------- /Viewer/iOS/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // iOS Viewer 4 | // 5 | // Created by Nick Lockwood on 16/01/2022. 6 | // Copyright © 2022 Nick Lockwood. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @main 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | var firstLaunchOfNewVersion: Bool = false 14 | 15 | func application(_: UIApplication, 16 | didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool 17 | { 18 | firstLaunchOfNewVersion = (Settings.shared.appVersion != appVersion) 19 | if firstLaunchOfNewVersion { 20 | Settings.shared.previousAppVersion = Settings.shared.appVersion 21 | Settings.shared.appVersion = appVersion 22 | } 23 | return true 24 | } 25 | 26 | func application( 27 | _: UIApplication, 28 | configurationForConnecting connectingSceneSession: UISceneSession, 29 | options _: UIScene.ConnectionOptions 30 | ) -> UISceneConfiguration { 31 | .init( 32 | name: "Default Configuration", 33 | sessionRole: connectingSceneSession.role 34 | ) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Viewer/iOS/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Viewer/iOS/Assets.xcassets/AppIcon.appiconset/1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/Viewer/iOS/Assets.xcassets/AppIcon.appiconset/1024.png -------------------------------------------------------------------------------- /Viewer/iOS/Assets.xcassets/AppIcon.appiconset/120-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/Viewer/iOS/Assets.xcassets/AppIcon.appiconset/120-1.png -------------------------------------------------------------------------------- /Viewer/iOS/Assets.xcassets/AppIcon.appiconset/120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/Viewer/iOS/Assets.xcassets/AppIcon.appiconset/120.png -------------------------------------------------------------------------------- /Viewer/iOS/Assets.xcassets/AppIcon.appiconset/152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/Viewer/iOS/Assets.xcassets/AppIcon.appiconset/152.png -------------------------------------------------------------------------------- /Viewer/iOS/Assets.xcassets/AppIcon.appiconset/167.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/Viewer/iOS/Assets.xcassets/AppIcon.appiconset/167.png -------------------------------------------------------------------------------- /Viewer/iOS/Assets.xcassets/AppIcon.appiconset/180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/Viewer/iOS/Assets.xcassets/AppIcon.appiconset/180.png -------------------------------------------------------------------------------- /Viewer/iOS/Assets.xcassets/AppIcon.appiconset/20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/Viewer/iOS/Assets.xcassets/AppIcon.appiconset/20.png -------------------------------------------------------------------------------- /Viewer/iOS/Assets.xcassets/AppIcon.appiconset/29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/Viewer/iOS/Assets.xcassets/AppIcon.appiconset/29.png -------------------------------------------------------------------------------- /Viewer/iOS/Assets.xcassets/AppIcon.appiconset/40-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/Viewer/iOS/Assets.xcassets/AppIcon.appiconset/40-1.png -------------------------------------------------------------------------------- /Viewer/iOS/Assets.xcassets/AppIcon.appiconset/40-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/Viewer/iOS/Assets.xcassets/AppIcon.appiconset/40-2.png -------------------------------------------------------------------------------- /Viewer/iOS/Assets.xcassets/AppIcon.appiconset/40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/Viewer/iOS/Assets.xcassets/AppIcon.appiconset/40.png -------------------------------------------------------------------------------- /Viewer/iOS/Assets.xcassets/AppIcon.appiconset/58-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/Viewer/iOS/Assets.xcassets/AppIcon.appiconset/58-1.png -------------------------------------------------------------------------------- /Viewer/iOS/Assets.xcassets/AppIcon.appiconset/58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/Viewer/iOS/Assets.xcassets/AppIcon.appiconset/58.png -------------------------------------------------------------------------------- /Viewer/iOS/Assets.xcassets/AppIcon.appiconset/60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/Viewer/iOS/Assets.xcassets/AppIcon.appiconset/60.png -------------------------------------------------------------------------------- /Viewer/iOS/Assets.xcassets/AppIcon.appiconset/76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/Viewer/iOS/Assets.xcassets/AppIcon.appiconset/76.png -------------------------------------------------------------------------------- /Viewer/iOS/Assets.xcassets/AppIcon.appiconset/80-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/Viewer/iOS/Assets.xcassets/AppIcon.appiconset/80-1.png -------------------------------------------------------------------------------- /Viewer/iOS/Assets.xcassets/AppIcon.appiconset/80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/Viewer/iOS/Assets.xcassets/AppIcon.appiconset/80.png -------------------------------------------------------------------------------- /Viewer/iOS/Assets.xcassets/AppIcon.appiconset/87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/Viewer/iOS/Assets.xcassets/AppIcon.appiconset/87.png -------------------------------------------------------------------------------- /Viewer/iOS/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Content.imageset/Back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/Viewer/iOS/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Content.imageset/Back.png -------------------------------------------------------------------------------- /Viewer/iOS/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Content.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "Back.png", 5 | "idiom" : "vision", 6 | "scale" : "2x" 7 | } 8 | ], 9 | "info" : { 10 | "author" : "xcode", 11 | "version" : 1 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Viewer/iOS/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Viewer/iOS/Assets.xcassets/AppIcon.solidimagestack/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | }, 6 | "layers" : [ 7 | { 8 | "filename" : "Front.solidimagestacklayer" 9 | }, 10 | { 11 | "filename" : "Middle.solidimagestacklayer" 12 | }, 13 | { 14 | "filename" : "Back.solidimagestacklayer" 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /Viewer/iOS/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Content.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "Front.png", 5 | "idiom" : "vision", 6 | "scale" : "2x" 7 | } 8 | ], 9 | "info" : { 10 | "author" : "xcode", 11 | "version" : 1 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Viewer/iOS/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Content.imageset/Front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/Viewer/iOS/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Content.imageset/Front.png -------------------------------------------------------------------------------- /Viewer/iOS/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Viewer/iOS/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Content.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "vision", 5 | "scale" : "2x" 6 | } 7 | ], 8 | "info" : { 9 | "author" : "xcode", 10 | "version" : 1 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Viewer/iOS/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Viewer/iOS/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Viewer/iOS/LicensesViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LicensesViewController.swift 3 | // Viewer (iOS) 4 | // 5 | // Created by Nick Lockwood on 23/04/2023. 6 | // Copyright © 2023 Nick Lockwood. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class LicensesViewController: WhatsNewViewController { 12 | override func viewDidLoad() { 13 | super.viewDidLoad() 14 | 15 | title = "Licenses" 16 | textView.attributedText = try! loadRTF("Licenses") 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Viewer/iOS/WhatsNewViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WhatsNewViewController.swift 3 | // Viewer (iOS) 4 | // 5 | // Created by Nick Lockwood on 23/04/2023. 6 | // Copyright © 2023 Nick Lockwood. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | func loadRTF(_ file: String) throws -> NSAttributedString { 12 | let file = Bundle.main.url(forResource: file, withExtension: "rtf")! 13 | let data = try! Data(contentsOf: file) 14 | let string = try NSMutableAttributedString(data: data, documentAttributes: nil) 15 | let range = NSRange(location: 0, length: string.length) 16 | string.addAttributes([.foregroundColor: UIColor.label], range: range) 17 | return string 18 | } 19 | 20 | class WhatsNewViewController: UIViewController { 21 | @IBOutlet private(set) var textView: UITextView! 22 | 23 | override func viewDidLoad() { 24 | super.viewDidLoad() 25 | 26 | title = "What's New in ShapeScript?" 27 | textView.attributedText = try! loadRTF("WhatsNew") 28 | 29 | navigationItem.leftBarButtonItem = UIBarButtonItem( 30 | systemItem: .close, 31 | primaryAction: UIAction { [weak self] _ in 32 | self?.dismiss(animated: true) 33 | } 34 | ) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /docs/1.5.10/ios/camera-control.md: -------------------------------------------------------------------------------- 1 | Camera Control 2 | --- 3 | 4 | When you open a file in ShapeScript, it is rendered in 3D using a virtual camera, which can be controlled via touch gestures. The camera is not part of the file itself, and moving it will not change the file in any way. 5 | 6 | ## Camera Selection 7 | 8 | By default, the camera is positioned along the Z axis, looking down at the model. The distance of the camera from the origin is set automatically based on the bounding sphere of the model. 9 | 10 | You can choose a different camera angle from the camera menu in the top right of the screen. [Custom cameras](cameras.md#custom-cameras) can be defined programatically. To reset the current camera to its default position, select `Reset View`. 11 | 12 | ## Touch Controls 13 | 14 | Motion | Action 15 | :--------------------------- | :-------------------------- 16 | Rotate model | Swipe with one finger 17 | Pan up/down/left/right | Swipe with two fingers 18 | Zoom in and out | Pinch 19 | Roll | Pinch, then rotate fingers 20 | 21 | ## Copy Settings 22 | 23 | To copy the configuration for the current camera view, select `Copy Settings` from the camera menu. This will copy a snippet of ShapeScript code which you can then paste into your `.shape` file to define a [custom camera](cameras.md#custom-cameras). 24 | 25 | --- 26 | [Index](index.md) | Next: [Primitives](primitives.md) 27 | -------------------------------------------------------------------------------- /docs/1.5.10/ios/comments.md: -------------------------------------------------------------------------------- 1 | Comments 2 | --- 3 | 4 | Any content that follows a `//` (double slash) is treated as a comment. Comments can appear at the start of a line, or at the end. The comment terminates at the next line-break. 5 | 6 | Comments can be used to document individual lines of code, or whole blocks. For example: 7 | 8 | ```swift 9 | color 1 0 0 // red 10 | 11 | // this code draws a triangle 12 | fill path { 13 | for 0 to 3 { 14 | point 0 1 15 | rotate 2 / 3 16 | } 17 | } 18 | ``` 19 | 20 | Comments are also useful for temporarily disabling a block of code when debugging a model. Some editors (such as Xcode) allow you to comment or uncomment multiple lines of code at once by making a multi-line selection and then pressing **Cmd-/** on the keyboard. 21 | 22 | --- 23 | [Index](index.md) | Next: [Literals](literals.md) 24 | -------------------------------------------------------------------------------- /docs/1.5.10/ios/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs, etc. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [options](options.md) (material, detail, etc.) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the position of subsequent shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../../images/group.png) 38 | 39 | **Note:** Changes made to properties such as transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Paths](paths.md) 43 | -------------------------------------------------------------------------------- /docs/1.5.10/mac/comments.md: -------------------------------------------------------------------------------- 1 | Comments 2 | --- 3 | 4 | Any content that follows a `//` (double slash) is treated as a comment. Comments can appear at the start of a line, or at the end. The comment terminates at the next line-break. 5 | 6 | Comments can be used to document individual lines of code, or whole blocks. For example: 7 | 8 | ```swift 9 | color 1 0 0 // red 10 | 11 | // this code draws a triangle 12 | fill path { 13 | for 0 to 3 { 14 | point 0 1 15 | rotate 2 / 3 16 | } 17 | } 18 | ``` 19 | 20 | Comments are also useful for temporarily disabling a block of code when debugging a model. Some editors (such as Xcode) allow you to comment or uncomment multiple lines of code at once by making a multi-line selection and then pressing **Cmd-/** on the keyboard. 21 | 22 | --- 23 | [Index](index.md) | Next: [Literals](literals.md) 24 | -------------------------------------------------------------------------------- /docs/1.5.10/mac/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs, etc. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [options](options.md) (material, detail, etc.) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the position of subsequent shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../../images/group.png) 38 | 39 | **Note:** Changes made to properties such as transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Paths](paths.md) 43 | -------------------------------------------------------------------------------- /docs/1.5.11: -------------------------------------------------------------------------------- 1 | 1.5.10 -------------------------------------------------------------------------------- /docs/1.5.12: -------------------------------------------------------------------------------- 1 | 1.5.10 -------------------------------------------------------------------------------- /docs/1.5.13: -------------------------------------------------------------------------------- 1 | 1.5.10 -------------------------------------------------------------------------------- /docs/1.5.14/ios/camera-control.md: -------------------------------------------------------------------------------- 1 | Camera Control 2 | --- 3 | 4 | When you open a file in ShapeScript, it is rendered in 3D using a virtual camera, which can be controlled via touch gestures. The camera is not part of the file itself, and moving it will not change the file in any way. 5 | 6 | ## Camera Selection 7 | 8 | By default, the camera is positioned along the Z axis, looking down at the model. The distance of the camera from the origin is set automatically based on the bounding sphere of the model. 9 | 10 | You can choose a different camera angle from the camera menu in the top right of the screen. [Custom cameras](cameras.md#custom-cameras) can be defined programatically. To reset the current camera to its default position, select `Reset View`. 11 | 12 | ## Touch Controls 13 | 14 | Motion | Action 15 | :--------------------------- | :-------------------------- 16 | Rotate model | Swipe with one finger 17 | Pan up/down/left/right | Swipe with two fingers 18 | Zoom in and out | Pinch 19 | Roll | Pinch, then rotate fingers 20 | 21 | ## Copy Settings 22 | 23 | To copy the configuration for the current camera view, select `Copy Settings` from the camera menu. This will copy a snippet of ShapeScript code which you can then paste into your `.shape` file to define a [custom camera](cameras.md#custom-cameras). 24 | 25 | --- 26 | [Index](index.md) | Next: [Primitives](primitives.md) 27 | -------------------------------------------------------------------------------- /docs/1.5.14/ios/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs, etc. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [options](options.md) (material, detail, etc.) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the position of subsequent shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../../images/group.png) 38 | 39 | **Note:** Changes made to properties such as transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Paths](paths.md) 43 | -------------------------------------------------------------------------------- /docs/1.5.14/mac/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs, etc. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [options](options.md) (material, detail, etc.) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the position of subsequent shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../../images/group.png) 38 | 39 | **Note:** Changes made to properties such as transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Paths](paths.md) 43 | -------------------------------------------------------------------------------- /docs/1.5.6/ios/camera-control.md: -------------------------------------------------------------------------------- 1 | Camera Control 2 | --- 3 | 4 | When you open a file in ShapeScript, it is rendered in 3D using a virtual camera, which can be controlled via touch gestures. The camera is not part of the file itself, and moving it will not change the file in any way. 5 | 6 | ## Camera Selection 7 | 8 | By default, the camera is positioned along the Z axis, looking down at the model. The distance of the camera from the origin is set automatically based on the bounding sphere of the model. 9 | 10 | You can choose a different camera angle from the camera menu in the top right of the screen. Custom cameras [can be defined](cameras.md) programatically. To reset the current camera to its default position, select `Reset View`. 11 | 12 | ## Touch Controls 13 | 14 | Motion | Action 15 | :--------------------------- | :-------------------------- 16 | Rotate model | Swipe with one finger 17 | Pan up/down/left/right | Swipe with two fingers 18 | Zoom in and out | Pinch 19 | Roll | Pinch, then rotate fingers 20 | 21 | ## Copy Settings 22 | 23 | To copy the configuration for the current camera view, select `Copy Settings` from the camera menu. This will copy a snippet of ShapeScript code which you can then paste into your `.shape` file to define a [custom camera](cameras.md#custom-cameras). 24 | 25 | --- 26 | [Index](index.md) | Next: [Primitives](primitives.md) 27 | -------------------------------------------------------------------------------- /docs/1.5.6/ios/comments.md: -------------------------------------------------------------------------------- 1 | Comments 2 | --- 3 | 4 | Any content that follows a `//` (double slash) is treated as a comment. Comments can appear at the start of a line, or at the end. The comment terminates at the next line-break. 5 | 6 | Comments can be used to document individual lines of code, or whole blocks. For example: 7 | 8 | ```swift 9 | color 1 0 0 // red 10 | 11 | // this code draws a triangle 12 | fill path { 13 | for 0 to 3 { 14 | point 0 1 15 | rotate 2 / 3 16 | } 17 | } 18 | ``` 19 | 20 | Comments are also useful for temporarily disabling a block of code when debugging a model. Some editors (such as Xcode) allow you to comment or uncomment multiple lines of code at once by making a multi-line selection and then pressing **Cmd-/** on the keyboard. 21 | 22 | --- 23 | [Index](index.md) | Next: [Literals](literals.md) 24 | -------------------------------------------------------------------------------- /docs/1.5.6/ios/glossary.md: -------------------------------------------------------------------------------- 1 | Glossary 2 | --- 3 | 4 | Term | Definition 5 | :--------------------| :-------------------------- 6 | Block | A group of commands inside braces (sometimes synonymous with Scope) 7 | Builder | A command for creating a 3D mesh out of one or more 2D paths 8 | Color | An RGBA color to be applied to a mesh or vertex 9 | CSG | Constructive Solid Geometry - adding or subtracting meshes to make new shapes 10 | Function | A named, parameterized block that returns a value 11 | Geometry | A collective term for 2D or 3D shapes produced using ShapeScript 12 | Group | A group of paths or meshes. May also contain nested groups 13 | Material | A color or texture 14 | Mesh | A 3D shape made of polygons 15 | Member | A single component of a compound value like a vector or tuple 16 | Path | A line or curve in 3D space. May be open-ended or closed 17 | Primitive | A simple, built-in shape like a cube or sphere 18 | Range | A numeric range with a start, end and step value 19 | Scope | A section of code with its own symbol namespace 20 | Symbol | A named constant value or function 21 | Texture | An image map to be wrapped around a mesh 22 | Transform | A combined translation, rotation and scale 23 | Translation | A relative or absolute position or offset in 3D space 24 | Tuple | A list of values that can be accessed with .first, .second, etc. 25 | Vector | A position, direction or distance in 3D space 26 | 27 | --- 28 | [Index](index.md) -------------------------------------------------------------------------------- /docs/1.5.6/ios/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [material](materials.md) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the relative transforms for shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../../images/group.png) 38 | 39 | Changes made to the transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Paths](paths.md) 43 | -------------------------------------------------------------------------------- /docs/1.5.6/mac/comments.md: -------------------------------------------------------------------------------- 1 | Comments 2 | --- 3 | 4 | Any content that follows a `//` (double slash) is treated as a comment. Comments can appear at the start of a line, or at the end. The comment terminates at the next line-break. 5 | 6 | Comments can be used to document individual lines of code, or whole blocks. For example: 7 | 8 | ```swift 9 | color 1 0 0 // red 10 | 11 | // this code draws a triangle 12 | fill path { 13 | for 0 to 3 { 14 | point 0 1 15 | rotate 2 / 3 16 | } 17 | } 18 | ``` 19 | 20 | Comments are also useful for temporarily disabling a block of code when debugging a model. Some editors (such as Xcode) allow you to comment or uncomment multiple lines of code at once by making a multi-line selection and then pressing **Cmd-/** on the keyboard. 21 | 22 | --- 23 | [Index](index.md) | Next: [Literals](literals.md) 24 | -------------------------------------------------------------------------------- /docs/1.5.6/mac/glossary.md: -------------------------------------------------------------------------------- 1 | Glossary 2 | --- 3 | 4 | Term | Definition 5 | :--------------------| :-------------------------- 6 | Block | A group of commands inside braces (sometimes synonymous with Scope) 7 | Builder | A command for creating a 3D mesh out of one or more 2D paths 8 | Color | An RGBA color to be applied to a mesh or vertex 9 | CSG | Constructive Solid Geometry - adding or subtracting meshes to make new shapes 10 | Function | A named, parameterized block that returns a value 11 | Geometry | A collective term for 2D or 3D shapes produced using ShapeScript 12 | Group | A group of paths or meshes. May also contain nested groups 13 | Material | A color or texture 14 | Mesh | A 3D shape made of polygons 15 | Member | A single component of a compound value like a vector or tuple 16 | Path | A line or curve in 3D space. May be open-ended or closed 17 | Primitive | A simple, built-in shape like a cube or sphere 18 | Range | A numeric range with a start, end and step value 19 | Scope | A section of code with its own symbol namespace 20 | Symbol | A named constant value or function 21 | Texture | An image map to be wrapped around a mesh 22 | Transform | A combined translation, rotation and scale 23 | Translation | A relative or absolute position or offset in 3D space 24 | Tuple | A list of values that can be accessed with .first, .second, etc. 25 | Vector | A position, direction or distance in 3D space 26 | 27 | --- 28 | [Index](index.md) -------------------------------------------------------------------------------- /docs/1.5.6/mac/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [material](materials.md) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the relative transforms for shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../../images/group.png) 38 | 39 | Changes made to the transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Paths](paths.md) 43 | -------------------------------------------------------------------------------- /docs/1.5.7: -------------------------------------------------------------------------------- 1 | 1.5.6 -------------------------------------------------------------------------------- /docs/1.5.8: -------------------------------------------------------------------------------- 1 | 1.5.6 -------------------------------------------------------------------------------- /docs/1.5.9: -------------------------------------------------------------------------------- 1 | 1.5.6 -------------------------------------------------------------------------------- /docs/1.6.0/ios/camera-control.md: -------------------------------------------------------------------------------- 1 | Camera Control 2 | --- 3 | 4 | When you open a file in ShapeScript, it is rendered in 3D using a virtual camera, which can be controlled via touch gestures. The camera is not part of the file itself, and moving it will not change the file in any way. 5 | 6 | ## Camera Selection 7 | 8 | By default, the camera is positioned along the Z axis, looking down at the model. The distance of the camera from the origin is set automatically based on the bounding sphere of the model. 9 | 10 | You can choose a different camera angle from the camera menu in the top right of the screen. [Custom cameras](cameras.md#custom-cameras) can be defined programatically. To reset the current camera to its default position, select `Reset View`. 11 | 12 | ## Touch Controls 13 | 14 | Motion | Action 15 | :--------------------------- | :-------------------------- 16 | Rotate model | Swipe with one finger 17 | Pan up/down/left/right | Swipe with two fingers 18 | Zoom in and out | Pinch 19 | Roll | Pinch, then rotate fingers 20 | 21 | ## Copy Settings 22 | 23 | To copy the configuration for the current camera view, select `Copy Settings` from the camera menu. This will copy a snippet of ShapeScript code which you can then paste into your `.shape` file to define a [custom camera](cameras.md#custom-cameras). 24 | 25 | --- 26 | [Index](index.md) | Next: [Primitives](primitives.md) 27 | -------------------------------------------------------------------------------- /docs/1.6.0/ios/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs, etc. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [options](options.md) (material, detail, etc.) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the position of subsequent shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../../images/group.png) 38 | 39 | **Note:** Changes made to properties such as transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Lights](lights.md) 43 | -------------------------------------------------------------------------------- /docs/1.6.0/mac/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs, etc. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [options](options.md) (material, detail, etc.) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the position of subsequent shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../../images/group.png) 38 | 39 | **Note:** Changes made to properties such as transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Lights](lights.md) 43 | -------------------------------------------------------------------------------- /docs/1.6.1/ios/camera-control.md: -------------------------------------------------------------------------------- 1 | Camera Control 2 | --- 3 | 4 | When you open a file in ShapeScript, it is rendered in 3D using a virtual camera, which can be controlled via touch gestures. The camera is not part of the file itself, and moving it will not change the file in any way. 5 | 6 | ## Camera Selection 7 | 8 | By default, the camera is positioned along the Z axis, looking down at the model. The distance of the camera from the origin is set automatically based on the bounding sphere of the model. 9 | 10 | You can choose a different camera angle from the camera menu in the top right of the screen. [Custom cameras](cameras.md#custom-cameras) can be defined programatically. To reset the current camera to its default position, select `Reset View`. 11 | 12 | ## Touch Controls 13 | 14 | Motion | Action 15 | :--------------------------- | :-------------------------- 16 | Rotate model | Swipe with one finger 17 | Pan up/down/left/right | Swipe with two fingers 18 | Zoom in and out | Pinch 19 | Roll | Pinch, then rotate fingers 20 | 21 | ## Copy Settings 22 | 23 | To copy the configuration for the current camera view, select `Copy Settings` from the camera menu. This will copy a snippet of ShapeScript code which you can then paste into your `.shape` file to define a [custom camera](cameras.md#custom-cameras). 24 | 25 | --- 26 | [Index](index.md) | Next: [Primitives](primitives.md) 27 | -------------------------------------------------------------------------------- /docs/1.6.1/ios/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs, etc. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [options](options.md) (material, detail, etc.) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the position of subsequent shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../../images/group.png) 38 | 39 | **Note:** Changes made to properties such as transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Lights](lights.md) 43 | -------------------------------------------------------------------------------- /docs/1.6.1/mac/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs, etc. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [options](options.md) (material, detail, etc.) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the position of subsequent shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../../images/group.png) 38 | 39 | **Note:** Changes made to properties such as transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Lights](lights.md) 43 | -------------------------------------------------------------------------------- /docs/1.6.10: -------------------------------------------------------------------------------- 1 | 1.6.7 -------------------------------------------------------------------------------- /docs/1.6.11: -------------------------------------------------------------------------------- 1 | 1.6.7 -------------------------------------------------------------------------------- /docs/1.6.12/ios/camera-control.md: -------------------------------------------------------------------------------- 1 | Camera Control 2 | --- 3 | 4 | When you open a file in ShapeScript, it is rendered in 3D using a virtual camera, which can be controlled either programmatically or via touch gestures. 5 | 6 | ## Camera Selection 7 | 8 | The camera defaults to "Front" view, which is positioned along the Z axis, looking forward towards the scene. The distance of the camera from the origin is set automatically based on volume occupied by the shapes in the scene. 9 | 10 | You can choose a different camera angle from the camera menu in the top right of the screen. [Custom cameras](cameras.md#custom-cameras) can be defined programatically. ShapeScript will remember the last selected camera for each shape file. 11 | 12 | To temporarily change the camera position, you can alter the view using touch gestures (see below). To reset the current camera back to its original position, select `Reset View`. 13 | 14 | ## Touch Controls 15 | 16 | Motion | Action 17 | :--------------------------- | :-------------------------- 18 | Rotate scene | Swipe with one finger 19 | Pan up/down/left/right | Swipe with two fingers 20 | Zoom in and out | Pinch 21 | Roll | Pinch, then rotate fingers 22 | 23 | ## Copy Settings 24 | 25 | It can be difficult to visualize the effect that a given position or orientation will have when defining a [custom camera](cameras.md#custom-cameras). A good solution is to use touch gestures to position the camera, then select `Copy Settings` from the camera menu. 26 | 27 | This copies a snippet of ShapeScript code which you can then paste into your `.shape` file to create the custom camera. 28 | 29 | --- 30 | [Index](index.md) | Next: [Primitives](primitives.md) 31 | -------------------------------------------------------------------------------- /docs/1.6.12/ios/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs, etc. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [options](options.md) (material, detail, etc.) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the position of subsequent shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../../images/group.png) 38 | 39 | **Note:** Changes made to properties such as transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Lights](lights.md) 43 | -------------------------------------------------------------------------------- /docs/1.6.12/mac/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs, etc. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [options](options.md) (material, detail, etc.) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the position of subsequent shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../../images/group.png) 38 | 39 | **Note:** Changes made to properties such as transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Lights](lights.md) 43 | -------------------------------------------------------------------------------- /docs/1.6.13: -------------------------------------------------------------------------------- 1 | 1.6.12 -------------------------------------------------------------------------------- /docs/1.6.14: -------------------------------------------------------------------------------- 1 | 1.6.12 -------------------------------------------------------------------------------- /docs/1.6.2: -------------------------------------------------------------------------------- 1 | 1.6.1 -------------------------------------------------------------------------------- /docs/1.6.3/ios/camera-control.md: -------------------------------------------------------------------------------- 1 | Camera Control 2 | --- 3 | 4 | When you open a file in ShapeScript, it is rendered in 3D using a virtual camera, which can be controlled via touch gestures. The camera is not part of the file itself, and moving it will not change the file in any way. 5 | 6 | ## Camera Selection 7 | 8 | By default, the camera is positioned along the Z axis, looking down at the scene. The distance of the camera from the origin is set automatically based on the bounding sphere of the scene. 9 | 10 | You can choose a different camera angle from the camera menu in the top right of the screen. [Custom cameras](cameras.md#custom-cameras) can be defined programatically. To reset the current camera to its default position, select `Reset View`. 11 | 12 | ## Touch Controls 13 | 14 | Motion | Action 15 | :--------------------------- | :-------------------------- 16 | Rotate scene | Swipe with one finger 17 | Pan up/down/left/right | Swipe with two fingers 18 | Zoom in and out | Pinch 19 | Roll | Pinch, then rotate fingers 20 | 21 | ## Copy Settings 22 | 23 | To copy the configuration for the current camera view, select `Copy Settings` from the camera menu. This will copy a snippet of ShapeScript code which you can then paste into your `.shape` file to define a [custom camera](cameras.md#custom-cameras). 24 | 25 | --- 26 | [Index](index.md) | Next: [Primitives](primitives.md) 27 | -------------------------------------------------------------------------------- /docs/1.6.3/ios/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs, etc. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [options](options.md) (material, detail, etc.) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the position of subsequent shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../../images/group.png) 38 | 39 | **Note:** Changes made to properties such as transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Lights](lights.md) 43 | -------------------------------------------------------------------------------- /docs/1.6.3/mac/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs, etc. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [options](options.md) (material, detail, etc.) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the position of subsequent shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../../images/group.png) 38 | 39 | **Note:** Changes made to properties such as transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Lights](lights.md) 43 | -------------------------------------------------------------------------------- /docs/1.6.4: -------------------------------------------------------------------------------- 1 | 1.6.3 -------------------------------------------------------------------------------- /docs/1.6.5: -------------------------------------------------------------------------------- 1 | 1.6.3 -------------------------------------------------------------------------------- /docs/1.6.6: -------------------------------------------------------------------------------- 1 | 1.6.3 -------------------------------------------------------------------------------- /docs/1.6.7/ios/camera-control.md: -------------------------------------------------------------------------------- 1 | Camera Control 2 | --- 3 | 4 | When you open a file in ShapeScript, it is rendered in 3D using a virtual camera, which can be controlled via touch gestures. The camera is not part of the file itself, and moving it will not change the file in any way. 5 | 6 | ## Camera Selection 7 | 8 | By default, the camera is positioned along the Z axis, looking down at the scene. The distance of the camera from the origin is set automatically based on the bounding sphere of the scene. 9 | 10 | You can choose a different camera angle from the camera menu in the top right of the screen. [Custom cameras](cameras.md#custom-cameras) can be defined programatically. To reset the current camera to its default position, select `Reset View`. 11 | 12 | ## Touch Controls 13 | 14 | Motion | Action 15 | :--------------------------- | :-------------------------- 16 | Rotate scene | Swipe with one finger 17 | Pan up/down/left/right | Swipe with two fingers 18 | Zoom in and out | Pinch 19 | Roll | Pinch, then rotate fingers 20 | 21 | ## Copy Settings 22 | 23 | To copy the configuration for the current camera view, select `Copy Settings` from the camera menu. This will copy a snippet of ShapeScript code which you can then paste into your `.shape` file to define a [custom camera](cameras.md#custom-cameras). 24 | 25 | --- 26 | [Index](index.md) | Next: [Primitives](primitives.md) 27 | -------------------------------------------------------------------------------- /docs/1.6.7/ios/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs, etc. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [options](options.md) (material, detail, etc.) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the position of subsequent shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../../images/group.png) 38 | 39 | **Note:** Changes made to properties such as transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Lights](lights.md) 43 | -------------------------------------------------------------------------------- /docs/1.6.7/mac/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs, etc. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [options](options.md) (material, detail, etc.) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the position of subsequent shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../../images/group.png) 38 | 39 | **Note:** Changes made to properties such as transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Lights](lights.md) 43 | -------------------------------------------------------------------------------- /docs/1.6.8: -------------------------------------------------------------------------------- 1 | 1.6.7 -------------------------------------------------------------------------------- /docs/1.6.9: -------------------------------------------------------------------------------- 1 | 1.6.7 -------------------------------------------------------------------------------- /docs/1.7.0: -------------------------------------------------------------------------------- 1 | 1.6.12 -------------------------------------------------------------------------------- /docs/1.7.1/ios/camera-control.md: -------------------------------------------------------------------------------- 1 | Camera Control 2 | --- 3 | 4 | When you open a file in ShapeScript, it is rendered in 3D using a virtual camera, which can be controlled either programmatically or via touch gestures. 5 | 6 | ## Camera Selection 7 | 8 | The camera defaults to "Front" view, which is positioned along the Z axis, looking forward towards the scene. The distance of the camera from the origin is set automatically based on volume occupied by the shapes in the scene. 9 | 10 | You can choose a different camera angle from the camera menu in the top right of the screen. [Custom cameras](cameras.md#custom-cameras) can be defined programatically. ShapeScript will remember the last selected camera for each shape file. 11 | 12 | To temporarily change the camera position, you can alter the view using touch gestures (see below). To reset the current camera back to its original position, select `Reset View`. 13 | 14 | ## Touch Controls 15 | 16 | Motion | Action 17 | :--------------------------- | :-------------------------- 18 | Rotate scene | Swipe with one finger 19 | Pan up/down/left/right | Swipe with two fingers 20 | Zoom in and out | Pinch 21 | Roll | Pinch, then rotate fingers 22 | 23 | ## Copy Settings 24 | 25 | It can be difficult to visualize the effect that a given position or orientation will have when defining a [custom camera](cameras.md#custom-cameras). A good solution is to use touch gestures to position the camera, then select `Copy Settings` from the camera menu. 26 | 27 | This copies a snippet of ShapeScript code which you can then paste into your `.shape` file to create the custom camera. 28 | 29 | --- 30 | [Index](index.md) | Next: [Primitives](primitives.md) 31 | -------------------------------------------------------------------------------- /docs/1.7.1/ios/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs, etc. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [options](options.md) (material, detail, etc.) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the position of subsequent shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../../images/group.png) 38 | 39 | **Note:** Changes made to properties such as transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Lights](lights.md) 43 | -------------------------------------------------------------------------------- /docs/1.7.1/mac/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs, etc. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [options](options.md) (material, detail, etc.) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the position of subsequent shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../../images/group.png) 38 | 39 | **Note:** Changes made to properties such as transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Lights](lights.md) 43 | -------------------------------------------------------------------------------- /docs/1.8.0/ios/camera-control.md: -------------------------------------------------------------------------------- 1 | Camera Control 2 | --- 3 | 4 | When you open a file in ShapeScript, it is rendered in 3D using a virtual camera, which can be controlled either programmatically or via touch gestures. 5 | 6 | ## Camera Selection 7 | 8 | The camera defaults to "Front" view, which is positioned along the Z axis, looking forward towards the scene. The distance of the camera from the origin is set automatically based on volume occupied by the shapes in the scene. 9 | 10 | You can choose a different camera angle from the camera menu in the top right of the screen. [Custom cameras](cameras.md#custom-cameras) can be defined programatically. ShapeScript will remember the last selected camera for each shape file. 11 | 12 | To temporarily change the camera position, you can alter the view using touch gestures (see below). To reset the current camera back to its original position, select `Reset View`. 13 | 14 | ## Touch Controls 15 | 16 | Motion | Action 17 | :--------------------------- | :-------------------------- 18 | Rotate scene | Swipe with one finger 19 | Pan up/down/left/right | Swipe with two fingers 20 | Zoom in and out | Pinch 21 | Roll | Pinch, then rotate fingers 22 | 23 | ## Copy Settings 24 | 25 | It can be difficult to visualize the effect that a given position or orientation will have when defining a [custom camera](cameras.md#custom-cameras). A good solution is to use touch gestures to position the camera, then select `Copy Settings` from the camera menu. 26 | 27 | This copies a snippet of ShapeScript code which you can then paste into your `.shape` file to create the custom camera. 28 | 29 | --- 30 | [Index](index.md) | Next: [Primitives](primitives.md) 31 | -------------------------------------------------------------------------------- /docs/1.8.0/ios/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs, etc. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [options](options.md) (material, detail, etc.) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the position of subsequent shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../../images/group.png) 38 | 39 | **Note:** Changes made to properties such as transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Lights](lights.md) 43 | -------------------------------------------------------------------------------- /docs/1.8.0/mac/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs, etc. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [options](options.md) (material, detail, etc.) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the position of subsequent shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../../images/group.png) 38 | 39 | **Note:** Changes made to properties such as transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Lights](lights.md) 43 | -------------------------------------------------------------------------------- /docs/1.8.1/ios/camera-control.md: -------------------------------------------------------------------------------- 1 | Camera Control 2 | --- 3 | 4 | When you open a file in ShapeScript, it is rendered in 3D using a virtual camera, which can be controlled either programmatically or via touch gestures. 5 | 6 | ## Camera Selection 7 | 8 | The camera defaults to "Front" view, which is positioned along the Z axis, looking forward towards the scene. The distance of the camera from the origin is set automatically based on volume occupied by the shapes in the scene. 9 | 10 | You can choose a different camera angle from the camera menu in the top right of the screen. [Custom cameras](cameras.md#custom-cameras) can be defined programatically. ShapeScript will remember the last selected camera for each shape file. 11 | 12 | To temporarily change the camera position, you can alter the view using touch gestures (see below). To reset the current camera back to its original position, select `Reset View`. 13 | 14 | ## Touch Controls 15 | 16 | Motion | Action 17 | :--------------------------- | :-------------------------- 18 | Rotate scene | Swipe with one finger 19 | Pan up/down/left/right | Swipe with two fingers 20 | Zoom in and out | Pinch 21 | Roll | Pinch, then rotate fingers 22 | 23 | ## Copy Settings 24 | 25 | It can be difficult to visualize the effect that a given position or orientation will have when defining a [custom camera](cameras.md#custom-cameras). A good solution is to use touch gestures to position the camera, then select `Copy Settings` from the camera menu. 26 | 27 | This copies a snippet of ShapeScript code which you can then paste into your `.shape` file to create the custom camera. 28 | 29 | --- 30 | [Index](index.md) | Next: [Primitives](primitives.md) 31 | -------------------------------------------------------------------------------- /docs/1.8.1/ios/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs, etc. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [options](options.md) (material, detail, etc.) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the position of subsequent shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../../images/group.png) 38 | 39 | **Note:** Changes made to properties such as transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Lights](lights.md) 43 | -------------------------------------------------------------------------------- /docs/1.8.1/mac/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs, etc. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [options](options.md) (material, detail, etc.) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the position of subsequent shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../../images/group.png) 38 | 39 | **Note:** Changes made to properties such as transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Lights](lights.md) 43 | -------------------------------------------------------------------------------- /docs/1.8.10: -------------------------------------------------------------------------------- 1 | 1.8.8 -------------------------------------------------------------------------------- /docs/1.8.2: -------------------------------------------------------------------------------- 1 | 1.8.1 -------------------------------------------------------------------------------- /docs/1.8.3: -------------------------------------------------------------------------------- 1 | 1.8.1 -------------------------------------------------------------------------------- /docs/1.8.4/ios/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs, etc. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [options](options.md) (material, detail, etc.) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the position of subsequent shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../../images/group.png) 38 | 39 | **Note:** Changes made to properties such as transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Lights](lights.md) 43 | -------------------------------------------------------------------------------- /docs/1.8.4/mac/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs, etc. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [options](options.md) (material, detail, etc.) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the position of subsequent shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../../images/group.png) 38 | 39 | **Note:** Changes made to properties such as transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Lights](lights.md) 43 | -------------------------------------------------------------------------------- /docs/1.8.5: -------------------------------------------------------------------------------- 1 | 1.8.4 -------------------------------------------------------------------------------- /docs/1.8.6/ios/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs, etc. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [options](options.md) (material, detail, etc.) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the position of subsequent shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../../images/group.png) 38 | 39 | **Note:** Changes made to properties such as transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Lights](lights.md) 43 | -------------------------------------------------------------------------------- /docs/1.8.6/mac/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs, etc. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [options](options.md) (material, detail, etc.) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the position of subsequent shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../../images/group.png) 38 | 39 | **Note:** Changes made to properties such as transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Lights](lights.md) 43 | -------------------------------------------------------------------------------- /docs/1.8.7/ios/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs, etc. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [options](options.md) (material, detail, etc.) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the position of subsequent shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../../images/group.png) 38 | 39 | **Note:** Changes made to properties such as transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Lights](lights.md) 43 | -------------------------------------------------------------------------------- /docs/1.8.7/mac/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs, etc. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [options](options.md) (material, detail, etc.) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the position of subsequent shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../../images/group.png) 38 | 39 | **Note:** Changes made to properties such as transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Lights](lights.md) 43 | -------------------------------------------------------------------------------- /docs/1.8.8/ios/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs, etc. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [options](options.md) (material, detail, etc.) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the position of subsequent shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../../images/group.png) 38 | 39 | **Note:** Changes made to properties such as transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Lights](lights.md) 43 | -------------------------------------------------------------------------------- /docs/1.8.8/mac/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs, etc. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [options](options.md) (material, detail, etc.) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the position of subsequent shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../../images/group.png) 38 | 39 | **Note:** Changes made to properties such as transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Lights](lights.md) 43 | -------------------------------------------------------------------------------- /docs/1.8.9: -------------------------------------------------------------------------------- 1 | 1.8.8 -------------------------------------------------------------------------------- /docs/CNAME: -------------------------------------------------------------------------------- 1 | shapescript.info -------------------------------------------------------------------------------- /docs/images/arc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/arc.png -------------------------------------------------------------------------------- /docs/images/axis-aligned-extrusion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/axis-aligned-extrusion.png -------------------------------------------------------------------------------- /docs/images/ball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/ball.png -------------------------------------------------------------------------------- /docs/images/box.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/box.png -------------------------------------------------------------------------------- /docs/images/camera-orientation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/camera-orientation.png -------------------------------------------------------------------------------- /docs/images/checkered-sphere.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/checkered-sphere.png -------------------------------------------------------------------------------- /docs/images/chessboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/chessboard.png -------------------------------------------------------------------------------- /docs/images/cog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/cog.png -------------------------------------------------------------------------------- /docs/images/colored-triangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/colored-triangle.png -------------------------------------------------------------------------------- /docs/images/cone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/cone.png -------------------------------------------------------------------------------- /docs/images/cube-mesh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/cube-mesh.png -------------------------------------------------------------------------------- /docs/images/curved-slab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/curved-slab.png -------------------------------------------------------------------------------- /docs/images/custom-camera-menu-ios-1.6.3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/custom-camera-menu-ios-1.6.3.png -------------------------------------------------------------------------------- /docs/images/custom-camera-menu-ios-1.6.4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/custom-camera-menu-ios-1.6.4.png -------------------------------------------------------------------------------- /docs/images/custom-camera-menu-ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/custom-camera-menu-ios.png -------------------------------------------------------------------------------- /docs/images/custom-camera-menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/custom-camera-menu.png -------------------------------------------------------------------------------- /docs/images/custom-camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/custom-camera.png -------------------------------------------------------------------------------- /docs/images/custom-fov.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/custom-fov.png -------------------------------------------------------------------------------- /docs/images/cylinder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/cylinder.png -------------------------------------------------------------------------------- /docs/images/detail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/detail.png -------------------------------------------------------------------------------- /docs/images/earth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/earth.png -------------------------------------------------------------------------------- /docs/images/error-screen-ios-1.6.3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/error-screen-ios-1.6.3.png -------------------------------------------------------------------------------- /docs/images/error-screen-ios-1.6.4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/error-screen-ios-1.6.4.png -------------------------------------------------------------------------------- /docs/images/error-screen-ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/error-screen-ios.png -------------------------------------------------------------------------------- /docs/images/error-screen-mac.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/error-screen-mac.png -------------------------------------------------------------------------------- /docs/images/even-odd-fill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/even-odd-fill.png -------------------------------------------------------------------------------- /docs/images/export-size-ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/export-size-ios.png -------------------------------------------------------------------------------- /docs/images/export-size.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/export-size.png -------------------------------------------------------------------------------- /docs/images/filled-pentagon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/filled-pentagon.png -------------------------------------------------------------------------------- /docs/images/green-glow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/green-glow.png -------------------------------------------------------------------------------- /docs/images/group-vs-difference.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/group-vs-difference.png -------------------------------------------------------------------------------- /docs/images/group-vs-union.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/group-vs-union.png -------------------------------------------------------------------------------- /docs/images/group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/group.png -------------------------------------------------------------------------------- /docs/images/hull-vs-loft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/hull-vs-loft.png -------------------------------------------------------------------------------- /docs/images/hull.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/hull.png -------------------------------------------------------------------------------- /docs/images/icosahedron.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/icosahedron.png -------------------------------------------------------------------------------- /docs/images/intersection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/intersection.png -------------------------------------------------------------------------------- /docs/images/left-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/left-light.png -------------------------------------------------------------------------------- /docs/images/line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/line.png -------------------------------------------------------------------------------- /docs/images/linespacing-decreased.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/linespacing-decreased.png -------------------------------------------------------------------------------- /docs/images/linespacing-increased.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/linespacing-increased.png -------------------------------------------------------------------------------- /docs/images/loading-ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/loading-ios.png -------------------------------------------------------------------------------- /docs/images/loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/loading.png -------------------------------------------------------------------------------- /docs/images/loftshape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/loftshape.png -------------------------------------------------------------------------------- /docs/images/metallicity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/metallicity.png -------------------------------------------------------------------------------- /docs/images/moon-debug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/moon-debug.png -------------------------------------------------------------------------------- /docs/images/moon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/moon.png -------------------------------------------------------------------------------- /docs/images/new-document-ios-1.6.3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/new-document-ios-1.6.3.png -------------------------------------------------------------------------------- /docs/images/new-document-ios-1.6.4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/new-document-ios-1.6.4.png -------------------------------------------------------------------------------- /docs/images/new-document-ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/new-document-ios.png -------------------------------------------------------------------------------- /docs/images/new-document-mac.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/new-document-mac.png -------------------------------------------------------------------------------- /docs/images/new-file-ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/new-file-ios.png -------------------------------------------------------------------------------- /docs/images/normal-map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/normal-map.png -------------------------------------------------------------------------------- /docs/images/not-watertight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/not-watertight.png -------------------------------------------------------------------------------- /docs/images/numbers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/numbers.png -------------------------------------------------------------------------------- /docs/images/object-info-ios-1.6.3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/object-info-ios-1.6.3.png -------------------------------------------------------------------------------- /docs/images/object-info-ios-1.6.4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/object-info-ios-1.6.4.png -------------------------------------------------------------------------------- /docs/images/object-info-ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/object-info-ios.png -------------------------------------------------------------------------------- /docs/images/object-info-mac.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/object-info-mac.png -------------------------------------------------------------------------------- /docs/images/octocircle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/octocircle.png -------------------------------------------------------------------------------- /docs/images/orthographic-camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/orthographic-camera.png -------------------------------------------------------------------------------- /docs/images/overlapping-circles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/overlapping-circles.png -------------------------------------------------------------------------------- /docs/images/path-colors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/path-colors.png -------------------------------------------------------------------------------- /docs/images/pawn-profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/pawn-profile.png -------------------------------------------------------------------------------- /docs/images/pawn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/pawn.png -------------------------------------------------------------------------------- /docs/images/pentagon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/pentagon.png -------------------------------------------------------------------------------- /docs/images/point-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/point-light.png -------------------------------------------------------------------------------- /docs/images/polygon-vs-circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/polygon-vs-circle.png -------------------------------------------------------------------------------- /docs/images/prism.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/prism.png -------------------------------------------------------------------------------- /docs/images/quarter-circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/quarter-circle.png -------------------------------------------------------------------------------- /docs/images/rectangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/rectangle.png -------------------------------------------------------------------------------- /docs/images/roundrect-extrusion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/roundrect-extrusion.png -------------------------------------------------------------------------------- /docs/images/roundrect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/roundrect.png -------------------------------------------------------------------------------- /docs/images/sandbox-error-ios-1.6.3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/sandbox-error-ios-1.6.3.png -------------------------------------------------------------------------------- /docs/images/sandbox-error-ios-1.6.4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/sandbox-error-ios-1.6.4.png -------------------------------------------------------------------------------- /docs/images/sandbox-error-ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/sandbox-error-ios.png -------------------------------------------------------------------------------- /docs/images/sandbox-error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/sandbox-error.png -------------------------------------------------------------------------------- /docs/images/semicircle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/semicircle.png -------------------------------------------------------------------------------- /docs/images/show-axes-ios-1.6.3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/show-axes-ios-1.6.3.png -------------------------------------------------------------------------------- /docs/images/show-axes-ios-1.6.4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/show-axes-ios-1.6.4.png -------------------------------------------------------------------------------- /docs/images/show-axes-ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/show-axes-ios.png -------------------------------------------------------------------------------- /docs/images/show-axes-mac.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/show-axes-mac.png -------------------------------------------------------------------------------- /docs/images/six-pointed-star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/six-pointed-star.png -------------------------------------------------------------------------------- /docs/images/smooth-arc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/smooth-arc.png -------------------------------------------------------------------------------- /docs/images/smoothed-hull.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/smoothed-hull.png -------------------------------------------------------------------------------- /docs/images/smoother-sphere.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/smoother-sphere.png -------------------------------------------------------------------------------- /docs/images/smoothing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/smoothing.png -------------------------------------------------------------------------------- /docs/images/solid-text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/solid-text.png -------------------------------------------------------------------------------- /docs/images/source-editor-ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/source-editor-ios.png -------------------------------------------------------------------------------- /docs/images/sphere.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/sphere.png -------------------------------------------------------------------------------- /docs/images/spheroid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/spheroid.png -------------------------------------------------------------------------------- /docs/images/spirals.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/spirals.png -------------------------------------------------------------------------------- /docs/images/split-view-ios-1.6.3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/split-view-ios-1.6.3.png -------------------------------------------------------------------------------- /docs/images/split-view-ios-1.6.4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/split-view-ios-1.6.4.png -------------------------------------------------------------------------------- /docs/images/split-view-ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/split-view-ios.png -------------------------------------------------------------------------------- /docs/images/spotlight-debug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/spotlight-debug.png -------------------------------------------------------------------------------- /docs/images/spotlight-sharp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/spotlight-sharp.png -------------------------------------------------------------------------------- /docs/images/spotlight-wide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/spotlight-wide.png -------------------------------------------------------------------------------- /docs/images/spotlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/spotlight.png -------------------------------------------------------------------------------- /docs/images/spring.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/spring.png -------------------------------------------------------------------------------- /docs/images/star-with-fitted-cube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/star-with-fitted-cube.png -------------------------------------------------------------------------------- /docs/images/star-with-fitted-rect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/star-with-fitted-rect.png -------------------------------------------------------------------------------- /docs/images/star-with-unit-cube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/star-with-unit-cube.png -------------------------------------------------------------------------------- /docs/images/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/star.png -------------------------------------------------------------------------------- /docs/images/stencil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/stencil.png -------------------------------------------------------------------------------- /docs/images/subtext-ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/subtext-ios.png -------------------------------------------------------------------------------- /docs/images/svgpath.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/svgpath.png -------------------------------------------------------------------------------- /docs/images/tangential-extrusion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/tangential-extrusion.png -------------------------------------------------------------------------------- /docs/images/text-centered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/text-centered.png -------------------------------------------------------------------------------- /docs/images/text-default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/text-default.png -------------------------------------------------------------------------------- /docs/images/text-font.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/text-font.png -------------------------------------------------------------------------------- /docs/images/text-wrap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/text-wrap.png -------------------------------------------------------------------------------- /docs/images/text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/text.png -------------------------------------------------------------------------------- /docs/images/textedit-mac.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/textedit-mac.png -------------------------------------------------------------------------------- /docs/images/textured-cone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/textured-cone.png -------------------------------------------------------------------------------- /docs/images/textured-cube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/textured-cube.png -------------------------------------------------------------------------------- /docs/images/textured-cylinder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/textured-cylinder.png -------------------------------------------------------------------------------- /docs/images/textured-sphere.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/textured-sphere.png -------------------------------------------------------------------------------- /docs/images/torus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/torus.png -------------------------------------------------------------------------------- /docs/images/train.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/train.png -------------------------------------------------------------------------------- /docs/images/triangle-polygon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/triangle-polygon.png -------------------------------------------------------------------------------- /docs/images/triangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/triangle.png -------------------------------------------------------------------------------- /docs/images/twisted-circle-seam.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/twisted-circle-seam.png -------------------------------------------------------------------------------- /docs/images/twisted-circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/twisted-circle.png -------------------------------------------------------------------------------- /docs/images/twisted-extrusion-wireframe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/twisted-extrusion-wireframe.png -------------------------------------------------------------------------------- /docs/images/twisted-extrusion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/twisted-extrusion.png -------------------------------------------------------------------------------- /docs/images/washed-out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/washed-out.png -------------------------------------------------------------------------------- /docs/images/xor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/xor.png -------------------------------------------------------------------------------- /docs/images/yellow-cube-ios-1.6.3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/yellow-cube-ios-1.6.3.png -------------------------------------------------------------------------------- /docs/images/yellow-cube-ios-1.6.4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/yellow-cube-ios-1.6.4.png -------------------------------------------------------------------------------- /docs/images/yellow-cube-ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/yellow-cube-ios.png -------------------------------------------------------------------------------- /docs/images/yellow-cube-mac.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/docs/images/yellow-cube-mac.png -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | ![Screenshot](https://raw.githubusercontent.com/nicklockwood/ShapeScript/master/images/Screenshot.jpg) 2 | 3 | Overview 4 | --- 5 | 6 | Welcome to ShapeScript. ShapeScript is a 3D modeling program for people who don't like 3D modeling programs. 7 | 8 | Instead of haphazardly dragging polygons and vertices around in a GUI, ShapeScript lets you define your models precisely using code. No math or art skills are required - ShapeScript does all the work for you. 9 | 10 | The ShapeScript app includes a parser for a simple language (also called "ShapeScript"). ShapeScript (the language) is a cross between a markup language and a programming language. 11 | 12 | You don't need to be a programmer to use ShapeScript. If you have ever worked with any kind of structured text like JSON or HTML then it should come naturally. But if you *do* have experience with programming, then you can apply those skills to create even more complex models by using loops, functions and variables to procedurally generate geometry. 13 | 14 | ShapeScript is available to download for free from the Mac and iOS App Stores: 15 | 16 | [Mac App Store](https://apps.apple.com/app/id1441135869) 17 | [App Store](https://apps.apple.com/app/id1606439346) 18 | 19 | --- 20 | 21 | [Mac documentation](mac/index.md) • [iOS documentation](ios/index.md) • [Source code](https://github.com/nicklockwood/ShapeScript) 22 | -------------------------------------------------------------------------------- /docs/ios/camera-control.md: -------------------------------------------------------------------------------- 1 | Camera Control 2 | --- 3 | 4 | When you open a file in ShapeScript, it is rendered in 3D using a virtual camera, which can be controlled either programmatically or via touch gestures. 5 | 6 | ## Camera Selection 7 | 8 | The camera defaults to "Front" view, which is positioned along the Z axis, looking forward towards the scene. The distance of the camera from the origin is set automatically based on volume occupied by the shapes in the scene. 9 | 10 | You can choose a different camera angle from the camera menu in the top right of the screen. [Custom cameras](cameras.md#custom-cameras) can be defined programatically. ShapeScript will remember the last selected camera for each shape file. 11 | 12 | To temporarily change the camera position, you can alter the view using touch gestures (see below). To reset the current camera back to its original position, select `Reset View`. 13 | 14 | ## Touch Controls 15 | 16 | Motion | Action 17 | :--------------------------- | :-------------------------- 18 | Rotate scene | Swipe with one finger 19 | Pan up/down/left/right | Swipe with two fingers 20 | Zoom in and out | Pinch 21 | Roll | Pinch, then rotate fingers 22 | 23 | ## Copy Settings 24 | 25 | It can be difficult to visualize the effect that a given position or orientation will have when defining a [custom camera](cameras.md#custom-cameras). A good solution is to use touch gestures to position the camera, then select `Copy Settings` from the camera menu. 26 | 27 | This copies a snippet of ShapeScript code which you can then paste into your `.shape` file to create the custom camera. 28 | 29 | --- 30 | [Index](index.md) | Next: [Primitives](primitives.md) 31 | -------------------------------------------------------------------------------- /docs/ios/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs, etc. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [options](options.md) (material, detail, etc.) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the position of subsequent shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../images/group.png) 38 | 39 | **Note:** Changes made to properties such as transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Lights](lights.md) 43 | -------------------------------------------------------------------------------- /docs/mac/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs, etc. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [options](options.md) (material, detail, etc.) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the position of subsequent shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../images/group.png) 38 | 39 | **Note:** Changes made to properties such as transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Lights](lights.md) 43 | -------------------------------------------------------------------------------- /docs/src/groups.md: -------------------------------------------------------------------------------- 1 | Groups 2 | --- 3 | 4 | Complex 3D shapes often follow a natural hierarchy - a car has wheels, or a torso has arms and legs, etc. You can create a hierarchy in ShapeScript by using the `group` command: 5 | 6 | ```swift 7 | group { 8 | position -0.5 0 0 9 | sphere { 10 | position 0 0 0 11 | } 12 | cylinder { 13 | position 1 0 0 14 | } 15 | } 16 | ``` 17 | 18 | Like other 3D shapes, a group has a `position` and `orientation` in 3D space, but it can also contain child shapes which inherit its coordinate system; if you move the group, its children move with it. The `position`, `orientation` and `size` properties of the children will be treated as relative to those of the containing group. 19 | 20 | You can override the current [options](options.md) (material, detail, etc.) at any point inside a group and only the subsequent children will be affected. You can also use [relative transform](transforms.md#relative-transforms) commands to manipulate the position of subsequent shapes inside the group: 21 | 22 | ```swift 23 | group { 24 | color 1 0 0 25 | sphere 26 | translate 1 27 | color 0 1 0 28 | cylinder 29 | translate 1 30 | rotate 0.1 31 | scale 0.5 32 | color 0 0 1 33 | cube 34 | } 35 | ``` 36 | 37 | ![Group](../images/group.png) 38 | 39 | **Note:** Changes made to properties such as transform or material are [scoped](scope.md) to the group, and will not carry beyond the closing `}`. 40 | 41 | --- 42 | [Index](index.md) | Next: [Lights](lights.md) 43 | -------------------------------------------------------------------------------- /images/Screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/images/Screenshot.jpg -------------------------------------------------------------------------------- /images/app-store-badge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/images/app-store-badge.png -------------------------------------------------------------------------------- /images/mac-app-store-badge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/ShapeScript/4a8917846d404b332f868450b1afd71317bb09db/images/mac-app-store-badge.png --------------------------------------------------------------------------------