{"id":2650,"date":"2025-01-24T14:43:45","date_gmt":"2025-01-24T19:43:45","guid":{"rendered":"https:\/\/stepinto.vision\/?p=2650"},"modified":"2025-01-25T05:21:12","modified_gmt":"2025-01-25T10:21:12","slug":"realitykit-basics-create-shapes","status":"publish","type":"post","link":"https:\/\/stepinto.vision\/example-code\/realitykit-basics-create-shapes\/","title":{"rendered":"RealityKit Basics: Create Shapes"},"content":{"rendered":"\n<p>Creating primitive shapes in code.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Overview<\/h2>\n\n\n\n<p>In RealityKit, we have two simple ways to create primitive shapes. <\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Directly in code<\/li>\n\n\n\n<li>In Reality Composer Pro<\/li>\n<\/ol>\n\n\n\n<p>Oddly, there these two have a different selection of shapes. For example, in code we can generate planes, but in Reality Composer Pro we can&#8217;t. <\/p>\n\n\n\n<p>Here are a few example of creating shapes in code. We place these in a volume.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" data-attachment-id=\"2663\" data-permalink=\"https:\/\/stepinto.vision\/example-code\/realitykit-basics-create-shapes\/attachment\/step-example-039-02\/\" data-orig-file=\"https:\/\/i0.wp.com\/stepinto.vision\/wp-content\/uploads\/2025\/01\/step-example-039-02.jpeg?fit=2732%2C2048&amp;ssl=1\" data-orig-size=\"2732,2048\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"step-example-039-02\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/stepinto.vision\/wp-content\/uploads\/2025\/01\/step-example-039-02.jpeg?fit=1024%2C768&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/stepinto.vision\/wp-content\/uploads\/2025\/01\/step-example-039-02.jpeg?resize=1024%2C768&#038;ssl=1\" alt=\"\" class=\"wp-image-2663\" style=\"aspect-ratio:16\/9;object-fit:cover\" srcset=\"https:\/\/i0.wp.com\/stepinto.vision\/wp-content\/uploads\/2025\/01\/step-example-039-02.jpeg?resize=1024%2C768&amp;ssl=1 1024w, https:\/\/i0.wp.com\/stepinto.vision\/wp-content\/uploads\/2025\/01\/step-example-039-02.jpeg?resize=300%2C225&amp;ssl=1 300w, https:\/\/i0.wp.com\/stepinto.vision\/wp-content\/uploads\/2025\/01\/step-example-039-02.jpeg?resize=768%2C576&amp;ssl=1 768w, https:\/\/i0.wp.com\/stepinto.vision\/wp-content\/uploads\/2025\/01\/step-example-039-02.jpeg?resize=1536%2C1151&amp;ssl=1 1536w, https:\/\/i0.wp.com\/stepinto.vision\/wp-content\/uploads\/2025\/01\/step-example-039-02.jpeg?resize=2048%2C1535&amp;ssl=1 2048w, https:\/\/i0.wp.com\/stepinto.vision\/wp-content\/uploads\/2025\/01\/step-example-039-02.jpeg?resize=1200%2C900&amp;ssl=1 1200w, https:\/\/i0.wp.com\/stepinto.vision\/wp-content\/uploads\/2025\/01\/step-example-039-02.jpeg?resize=800%2C600&amp;ssl=1 800w, https:\/\/i0.wp.com\/stepinto.vision\/wp-content\/uploads\/2025\/01\/step-example-039-02.jpeg?resize=600%2C450&amp;ssl=1 600w, https:\/\/i0.wp.com\/stepinto.vision\/wp-content\/uploads\/2025\/01\/step-example-039-02.jpeg?resize=400%2C300&amp;ssl=1 400w, https:\/\/i0.wp.com\/stepinto.vision\/wp-content\/uploads\/2025\/01\/step-example-039-02.jpeg?resize=200%2C150&amp;ssl=1 200w, https:\/\/i0.wp.com\/stepinto.vision\/wp-content\/uploads\/2025\/01\/step-example-039-02.jpeg?w=2580&amp;ssl=1 2580w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Example Code<\/h2>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#000000;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"struct Example038: View {\n    var body: some View {\n        RealityView { content, attachments in\n\n            \/\/ Create an empty entity we can use to group our shapes\n            let group = Entity()\n            content.add(group)\n            \/\/ We can move this group down in the volume and scale it to 50%.\n            group.position = [0, -0.25, 0]\n            group.scale = [0.5, 0.5, 0.5]\n\n            \/\/ Create shapes\n\n            \/\/ ModelEntity is a convenient way to create an entity with a model, shapes, and material.\n            let sphere = ModelEntity(\n                mesh: .generateSphere(radius: 0.1),\n                materials: [SimpleMaterial(color: .stepRed, isMetallic: false)])\n            \/\/ Set the position of the sphere relative to the group\n            sphere.setPosition([-0.5, 0, 0], relativeTo: group)\n            \/\/ Add the sphere as a child to the group\n            group.addChild(sphere)\n\n            let box = ModelEntity(\n                mesh: .generateBox(size: 0.2),\n                materials: [SimpleMaterial(color: .stepGreen, isMetallic: false)])\n            box.setPosition([0, -0.1, 0], relativeTo: group)\n            group.addChild(box)\n\n            let cylinder = ModelEntity(\n                mesh: .generateCylinder(height: 0.2, radius: 0.1),\n                materials: [SimpleMaterial(color: .stepBlue, isMetallic: false)])\n            cylinder.setPosition([0.5, 0, 0], relativeTo: group)\n            group.addChild(cylinder)\n\n            let cone = ModelEntity(\n                mesh: .generateCone(height: 0.2, radius: 0.075),\n                materials: [SimpleMaterial(color: .stepBlue, isMetallic: false)])\n            cone.setPosition([0.4, 0.5, 0], relativeTo: group)\n            group.addChild(cone)\n\n            let plane = ModelEntity(\n                mesh: .generatePlane(width: 0.2, height: 0.2),\n                materials: [SimpleMaterial(color: .stepGreen, isMetallic: false)])\n            plane.setPosition([-0.4, 0.5, 0], relativeTo: group)\n            group.addChild(plane)\n\n        } update: { content, attachments in\n            \/\/ More on update later\n        } attachments: {\n            \/\/ More on attachments later\n            Attachment(id: &quot;AttachmentContent&quot;) {\n                Text(&quot;&quot;)\n            }\n        }\n    }\n}\" style=\"color:#000000;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki light-plus\" style=\"background-color: #FFFFFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #0000FF\">struct<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #267F99\">Example038<\/span><span style=\"color: #000000\">: View {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">    <\/span><span style=\"color: #0000FF\">var<\/span><span style=\"color: #000000\"> body: some View {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">        RealityView { content, attachments <\/span><span style=\"color: #AF00DB\">in<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            <\/span><span style=\"color: #008000\">\/\/ Create an empty entity we can use to group our shapes<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            <\/span><span style=\"color: #0000FF\">let<\/span><span style=\"color: #000000\"> group = <\/span><span style=\"color: #795E26\">Entity<\/span><span style=\"color: #000000\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            content.<\/span><span style=\"color: #795E26\">add<\/span><span style=\"color: #000000\">(group)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            <\/span><span style=\"color: #008000\">\/\/ We can move this group down in the volume and scale it to 50%.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            group.<\/span><span style=\"color: #001080\">position<\/span><span style=\"color: #000000\"> = [<\/span><span style=\"color: #098658\">0<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #098658\">-0.25<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #098658\">0<\/span><span style=\"color: #000000\">]<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            group.<\/span><span style=\"color: #001080\">scale<\/span><span style=\"color: #000000\"> = [<\/span><span style=\"color: #098658\">0.5<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #098658\">0.5<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #098658\">0.5<\/span><span style=\"color: #000000\">]<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            <\/span><span style=\"color: #008000\">\/\/ Create shapes<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            <\/span><span style=\"color: #008000\">\/\/ ModelEntity is a convenient way to create an entity with a model, shapes, and material.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            <\/span><span style=\"color: #0000FF\">let<\/span><span style=\"color: #000000\"> sphere = <\/span><span style=\"color: #795E26\">ModelEntity<\/span><span style=\"color: #000000\">(<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">                <\/span><span style=\"color: #795E26\">mesh<\/span><span style=\"color: #000000\">: .<\/span><span style=\"color: #795E26\">generateSphere<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #795E26\">radius<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #098658\">0.1<\/span><span style=\"color: #000000\">),<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">                <\/span><span style=\"color: #795E26\">materials<\/span><span style=\"color: #000000\">: [<\/span><span style=\"color: #795E26\">SimpleMaterial<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #795E26\">color<\/span><span style=\"color: #000000\">: .<\/span><span style=\"color: #001080\">stepRed<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #795E26\">isMetallic<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #0000FF\">false<\/span><span style=\"color: #000000\">)])<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            <\/span><span style=\"color: #008000\">\/\/ Set the position of the sphere relative to the group<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            sphere.<\/span><span style=\"color: #795E26\">setPosition<\/span><span style=\"color: #000000\">([<\/span><span style=\"color: #098658\">-0.5<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #098658\">0<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #098658\">0<\/span><span style=\"color: #000000\">], <\/span><span style=\"color: #795E26\">relativeTo<\/span><span style=\"color: #000000\">: group)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            <\/span><span style=\"color: #008000\">\/\/ Add the sphere as a child to the group<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            group.<\/span><span style=\"color: #795E26\">addChild<\/span><span style=\"color: #000000\">(sphere)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            <\/span><span style=\"color: #0000FF\">let<\/span><span style=\"color: #000000\"> box = <\/span><span style=\"color: #795E26\">ModelEntity<\/span><span style=\"color: #000000\">(<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">                <\/span><span style=\"color: #795E26\">mesh<\/span><span style=\"color: #000000\">: .<\/span><span style=\"color: #795E26\">generateBox<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #795E26\">size<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #098658\">0.2<\/span><span style=\"color: #000000\">),<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">                <\/span><span style=\"color: #795E26\">materials<\/span><span style=\"color: #000000\">: [<\/span><span style=\"color: #795E26\">SimpleMaterial<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #795E26\">color<\/span><span style=\"color: #000000\">: .<\/span><span style=\"color: #001080\">stepGreen<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #795E26\">isMetallic<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #0000FF\">false<\/span><span style=\"color: #000000\">)])<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            box.<\/span><span style=\"color: #795E26\">setPosition<\/span><span style=\"color: #000000\">([<\/span><span style=\"color: #098658\">0<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #098658\">-0.1<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #098658\">0<\/span><span style=\"color: #000000\">], <\/span><span style=\"color: #795E26\">relativeTo<\/span><span style=\"color: #000000\">: group)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            group.<\/span><span style=\"color: #795E26\">addChild<\/span><span style=\"color: #000000\">(box)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            <\/span><span style=\"color: #0000FF\">let<\/span><span style=\"color: #000000\"> cylinder = <\/span><span style=\"color: #795E26\">ModelEntity<\/span><span style=\"color: #000000\">(<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">                <\/span><span style=\"color: #795E26\">mesh<\/span><span style=\"color: #000000\">: .<\/span><span style=\"color: #795E26\">generateCylinder<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #795E26\">height<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #098658\">0.2<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #795E26\">radius<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #098658\">0.1<\/span><span style=\"color: #000000\">),<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">                <\/span><span style=\"color: #795E26\">materials<\/span><span style=\"color: #000000\">: [<\/span><span style=\"color: #795E26\">SimpleMaterial<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #795E26\">color<\/span><span style=\"color: #000000\">: .<\/span><span style=\"color: #001080\">stepBlue<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #795E26\">isMetallic<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #0000FF\">false<\/span><span style=\"color: #000000\">)])<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            cylinder.<\/span><span style=\"color: #795E26\">setPosition<\/span><span style=\"color: #000000\">([<\/span><span style=\"color: #098658\">0.5<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #098658\">0<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #098658\">0<\/span><span style=\"color: #000000\">], <\/span><span style=\"color: #795E26\">relativeTo<\/span><span style=\"color: #000000\">: group)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            group.<\/span><span style=\"color: #795E26\">addChild<\/span><span style=\"color: #000000\">(cylinder)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            <\/span><span style=\"color: #0000FF\">let<\/span><span style=\"color: #000000\"> cone = <\/span><span style=\"color: #795E26\">ModelEntity<\/span><span style=\"color: #000000\">(<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">                <\/span><span style=\"color: #795E26\">mesh<\/span><span style=\"color: #000000\">: .<\/span><span style=\"color: #795E26\">generateCone<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #795E26\">height<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #098658\">0.2<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #795E26\">radius<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #098658\">0.075<\/span><span style=\"color: #000000\">),<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">                <\/span><span style=\"color: #795E26\">materials<\/span><span style=\"color: #000000\">: [<\/span><span style=\"color: #795E26\">SimpleMaterial<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #795E26\">color<\/span><span style=\"color: #000000\">: .<\/span><span style=\"color: #001080\">stepBlue<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #795E26\">isMetallic<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #0000FF\">false<\/span><span style=\"color: #000000\">)])<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            cone.<\/span><span style=\"color: #795E26\">setPosition<\/span><span style=\"color: #000000\">([<\/span><span style=\"color: #098658\">0.4<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #098658\">0.5<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #098658\">0<\/span><span style=\"color: #000000\">], <\/span><span style=\"color: #795E26\">relativeTo<\/span><span style=\"color: #000000\">: group)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            group.<\/span><span style=\"color: #795E26\">addChild<\/span><span style=\"color: #000000\">(cone)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            <\/span><span style=\"color: #0000FF\">let<\/span><span style=\"color: #000000\"> plane = <\/span><span style=\"color: #795E26\">ModelEntity<\/span><span style=\"color: #000000\">(<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">                <\/span><span style=\"color: #795E26\">mesh<\/span><span style=\"color: #000000\">: .<\/span><span style=\"color: #795E26\">generatePlane<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #795E26\">width<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #098658\">0.2<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #795E26\">height<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #098658\">0.2<\/span><span style=\"color: #000000\">),<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">                <\/span><span style=\"color: #795E26\">materials<\/span><span style=\"color: #000000\">: [<\/span><span style=\"color: #795E26\">SimpleMaterial<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #795E26\">color<\/span><span style=\"color: #000000\">: .<\/span><span style=\"color: #001080\">stepGreen<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #795E26\">isMetallic<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #0000FF\">false<\/span><span style=\"color: #000000\">)])<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            plane.<\/span><span style=\"color: #795E26\">setPosition<\/span><span style=\"color: #000000\">([<\/span><span style=\"color: #098658\">-0.4<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #098658\">0.5<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #098658\">0<\/span><span style=\"color: #000000\">], <\/span><span style=\"color: #795E26\">relativeTo<\/span><span style=\"color: #000000\">: group)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            group.<\/span><span style=\"color: #795E26\">addChild<\/span><span style=\"color: #000000\">(plane)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #000000\">        } update: { content, attachments <\/span><span style=\"color: #AF00DB\">in<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            <\/span><span style=\"color: #008000\">\/\/ More on update later<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">        } attachments: {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            <\/span><span style=\"color: #008000\">\/\/ More on attachments later<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            <\/span><span style=\"color: #795E26\">Attachment<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #795E26\">id<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #A31515\">&quot;AttachmentContent&quot;<\/span><span style=\"color: #000000\">) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">                <\/span><span style=\"color: #795E26\">Text<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #A31515\">&quot;&quot;<\/span><span style=\"color: #000000\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">        }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">    }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">}<\/span><\/span><\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Creating primitive shapes in code.<\/p>\n","protected":false},"author":93705089,"featured_media":2663,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"_EventAllDay":false,"_EventTimezone":"","_EventStartDate":"","_EventEndDate":"","_EventStartDateUTC":"","_EventEndDateUTC":"","_EventShowMap":false,"_EventShowMapLink":false,"_EventURL":"","_EventCost":"","_EventCostDescription":"","_EventCurrencySymbol":"","_EventCurrencyCode":"","_EventCurrencyPosition":"","_EventDateTimeSeparator":"","_EventTimeRangeSeparator":"","_EventOrganizerID":[],"_EventVenueID":[],"_OrganizerEmail":"","_OrganizerPhone":"","_OrganizerWebsite":"","_VenueAddress":"","_VenueCity":"","_VenueCountry":"","_VenueProvince":"","_VenueState":"","_VenueZip":"","_VenuePhone":"","_VenueURL":"","_VenueStateProvince":"","_VenueLat":"","_VenueLng":"","_VenueShowMap":false,"_VenueShowMapLink":false,"_kadence_starter_templates_imported_post":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2},"_wpas_customize_per_network":false,"jetpack_post_was_ever_published":false},"categories":[1365],"tags":[],"class_list":["post-2650","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-example-code"],"jetpack_publicize_connections":[],"taxonomy_info":{"category":[{"value":1365,"label":"Example Code"}]},"featured_image_src_large":["https:\/\/i0.wp.com\/stepinto.vision\/wp-content\/uploads\/2025\/01\/step-example-039-02.jpeg?fit=1024%2C768&ssl=1",1024,768,true],"author_info":{"display_name":"Joseph Simpson","author_link":"https:\/\/stepinto.vision\/author\/vrhermit\/"},"comment_info":0,"category_info":[{"term_id":1365,"name":"Example Code","slug":"example-code","term_group":0,"term_taxonomy_id":11,"taxonomy":"category","description":"Code snippets and examples of using common APIs throughout visionOS development","parent":0,"count":187,"filter":"raw","cat_ID":1365,"category_count":187,"category_description":"Code snippets and examples of using common APIs throughout visionOS development","cat_name":"Example Code","category_nicename":"example-code","category_parent":0}],"tag_info":false,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/stepinto.vision\/wp-content\/uploads\/2025\/01\/step-example-039-02.jpeg?fit=2732%2C2048&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/stepinto.vision\/wp-json\/wp\/v2\/posts\/2650","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/stepinto.vision\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stepinto.vision\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stepinto.vision\/wp-json\/wp\/v2\/users\/93705089"}],"replies":[{"embeddable":true,"href":"https:\/\/stepinto.vision\/wp-json\/wp\/v2\/comments?post=2650"}],"version-history":[{"count":9,"href":"https:\/\/stepinto.vision\/wp-json\/wp\/v2\/posts\/2650\/revisions"}],"predecessor-version":[{"id":2666,"href":"https:\/\/stepinto.vision\/wp-json\/wp\/v2\/posts\/2650\/revisions\/2666"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/stepinto.vision\/wp-json\/wp\/v2\/media\/2663"}],"wp:attachment":[{"href":"https:\/\/stepinto.vision\/wp-json\/wp\/v2\/media?parent=2650"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stepinto.vision\/wp-json\/wp\/v2\/categories?post=2650"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stepinto.vision\/wp-json\/wp\/v2\/tags?post=2650"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}