[{"data":1,"prerenderedAt":386},["ShallowReactive",2],{"branding":3,"navigation":11,"social":38,"\u002Fdocs\u002Fexamples\u002Fbox":57,"\u002Fdocs\u002Fexamples\u002Fbox-python":297,"\u002Fdocs\u002Fexamples\u002Fbox-surround":298,"docs-navigation":307},{"id":4,"title":5,"description":6,"extension":7,"meta":8,"stem":9,"__hash__":10},"branding\u002Fbranding.yml","COMPAS","The Progressive Python Framework for AEC","yml",{},"branding","RZe_zlUXQhPN3ap5X6d0zUmiqalxe1ZFVRnIsmTB9VU",{"id":12,"title":13,"extension":7,"items":14,"meta":35,"stem":36,"__hash__":37},"navigation\u002Fnavigation.yml","Main Navigation",[15,19,23,27,31],{"label":16,"icon":17,"to":18},"Docs","i-heroicons-book-open","\u002Fdocs\u002Foverview\u002Fintroduction",{"label":20,"icon":21,"to":22},"Packages","i-heroicons-puzzle-piece","\u002Fpackages",{"label":24,"icon":25,"to":26},"Association","i-heroicons-users","\u002Fassociation",{"label":28,"to":29,"icon":30},"News","\u002Fnews","i-heroicons-newspaper",{"label":32,"icon":33,"to":34},"Forum","i-heroicons-chat-bubble-left-right","https:\u002F\u002Fforum.compas-framework.org\u002F",{},"navigation","0jaKadsuS1w-R-2CifQeF-7No6HqrVyF7jIP80oFYoM",{"id":39,"title":40,"extension":7,"items":41,"meta":54,"stem":55,"__hash__":56},"social\u002Fsocial.yml","Social Media",[42,46,50],{"label":43,"to":44,"icon":45},"GitHub","https:\u002F\u002Fgithub.com\u002Fcompas-dev","i-simple-icons-github",{"label":47,"to":48,"icon":49},"X","https:\u002F\u002Fx.com\u002Fcompas_dev","i-simple-icons-x",{"label":51,"to":52,"icon":53},"LinkedIn","https:\u002F\u002Fwww.linkedin.com\u002Fcompany\u002Fcompas-association","i-simple-icons-linkedin",{},"social","495juwkNU0wtE_8lwERDZNWQES5uWYuMK_Wa6cQ9Wxg",{"id":58,"title":59,"body":60,"description":289,"extension":290,"headline":291,"meta":292,"navigation":198,"path":293,"seo":294,"stem":295,"__hash__":296},"docs\u002Fdocs\u002F3.examples\u002F1.box.md","Making a box",{"type":61,"value":62,"toc":285},"minimark",[63,75,80,164,168,263,274,281],[64,65,66,67,74],"p",{},"This example builds a box, rotates and moves it, turns it into a mesh and opens it in ",[68,69,73],"a",{"href":70,"rel":71},"https:\u002F\u002Fcompas-dev.github.io\u002Fcompas_viewer\u002F",[72],"nofollow","COMPAS Viewer",".",[76,77,79],"h2",{"id":78},"install-the-viewer","Install the viewer",[81,82,84,110,132,150],"code-group",{"sync":83},"pm",[85,86,92],"pre",{"className":87,"code":88,"filename":89,"language":90,"meta":91,"style":91},"language-bash shiki shiki-themes github-dark","uv add compas_viewer\n","uv","bash","",[93,94,95],"code",{"__ignoreMap":91},[96,97,100,103,107],"span",{"class":98,"line":99},"line",1,[96,101,89],{"class":102},"svObZ",[96,104,106],{"class":105},"sU2Wk"," add",[96,108,109],{"class":105}," compas_viewer\n",[85,111,114],{"className":87,"code":112,"filename":113,"language":90,"meta":91,"style":91},"mamba install -c conda-forge compas_viewer\n","mamba",[93,115,116],{"__ignoreMap":91},[96,117,118,120,123,127,130],{"class":98,"line":99},[96,119,113],{"class":102},[96,121,122],{"class":105}," install",[96,124,126],{"class":125},"sDLfK"," -c",[96,128,129],{"class":105}," conda-forge",[96,131,109],{"class":105},[85,133,136],{"className":87,"code":134,"filename":135,"language":90,"meta":91,"style":91},"conda install -c conda-forge compas_viewer\n","conda",[93,137,138],{"__ignoreMap":91},[96,139,140,142,144,146,148],{"class":98,"line":99},[96,141,135],{"class":102},[96,143,122],{"class":105},[96,145,126],{"class":125},[96,147,129],{"class":105},[96,149,109],{"class":105},[85,151,154],{"className":87,"code":152,"filename":153,"language":90,"meta":91,"style":91},"pip install compas_viewer\n","pip",[93,155,156],{"__ignoreMap":91},[96,157,158,160,162],{"class":98,"line":99},[96,159,153],{"class":102},[96,161,122],{"class":105},[96,163,109],{"class":105},[76,165,167],{"id":166},"the-script","The script",[85,169,174],{"className":170,"code":171,"filename":172,"language":173,"meta":91,"style":91},"language-python shiki shiki-themes github-dark","import math\nfrom compas.geometry import Box, Frame, Rotation, Translation\nfrom compas_viewer import Viewer\n\nbox = Box(1, 2, 3, frame=Frame.worldXY())\n\nT = Translation.from_vector([5, 0, 0])\nR = Rotation.from_axis_and_angle([0, 0, 1], math.radians(45))\nbox.transform(T * R)\n\nmesh = box.to_mesh()\n\nviewer = Viewer()\nviewer.scene.add(mesh)\nviewer.show()\n","box.py","python",[93,175,176,181,187,193,200,206,211,217,223,229,234,240,245,251,257],{"__ignoreMap":91},[96,177,178],{"class":98,"line":99},[96,179,180],{},"import math\n",[96,182,184],{"class":98,"line":183},2,[96,185,186],{},"from compas.geometry import Box, Frame, Rotation, Translation\n",[96,188,190],{"class":98,"line":189},3,[96,191,192],{},"from compas_viewer import Viewer\n",[96,194,196],{"class":98,"line":195},4,[96,197,199],{"emptyLinePlaceholder":198},true,"\n",[96,201,203],{"class":98,"line":202},5,[96,204,205],{},"box = Box(1, 2, 3, frame=Frame.worldXY())\n",[96,207,209],{"class":98,"line":208},6,[96,210,199],{"emptyLinePlaceholder":198},[96,212,214],{"class":98,"line":213},7,[96,215,216],{},"T = Translation.from_vector([5, 0, 0])\n",[96,218,220],{"class":98,"line":219},8,[96,221,222],{},"R = Rotation.from_axis_and_angle([0, 0, 1], math.radians(45))\n",[96,224,226],{"class":98,"line":225},9,[96,227,228],{},"box.transform(T * R)\n",[96,230,232],{"class":98,"line":231},10,[96,233,199],{"emptyLinePlaceholder":198},[96,235,237],{"class":98,"line":236},11,[96,238,239],{},"mesh = box.to_mesh()\n",[96,241,243],{"class":98,"line":242},12,[96,244,199],{"emptyLinePlaceholder":198},[96,246,248],{"class":98,"line":247},13,[96,249,250],{},"viewer = Viewer()\n",[96,252,254],{"class":98,"line":253},14,[96,255,256],{},"viewer.scene.add(mesh)\n",[96,258,260],{"class":98,"line":259},15,[96,261,262],{},"viewer.show()\n",[64,264,265,266,269,270,273],{},"Run it with ",[93,267,268],{},"python box.py",", or ",[93,271,272],{},"uv run box.py",". A window opens with the box; drag to orbit and scroll to zoom.",[64,275,276,277,280],{},"Transformations are 4x4 matrices. Combine them with ",[93,278,279],{},"*","; the right-hand one applies first, so the box rotates about the world origin and then moves.",[282,283,284],"style",{},"html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}",{"title":91,"searchDepth":183,"depth":183,"links":286},[287,288],{"id":78,"depth":183,"text":79},{"id":166,"depth":183,"text":167},"Make a box, move it, and show it in COMPAS Viewer","md","Examples",{},"\u002Fdocs\u002Fexamples\u002Fbox",{"title":59,"description":289},"docs\u002F3.examples\u002F1.box","r2FoBLyXn0kMgzb7m5maxz4avH0Xy-hGoKRcihSInWk",null,[299,303],{"title":300,"path":301,"stem":302,"children":-1},"Developer-Friendly Foundation","\u002Fdocs\u002Ffeatures\u002Fdevelopers","docs\u002F2.features\u002F6.developers",{"title":304,"path":305,"stem":306,"children":-1},"Points and vectors","\u002Fdocs\u002Fexamples\u002Fpoints-and-vectors","docs\u002F3.examples\u002F2.points-and-vectors",[308],{"title":16,"path":309,"stem":310,"children":311,"page":337},"\u002Fdocs","docs",[312,338,365,376],{"title":313,"icon":314,"path":315,"stem":316,"children":317,"page":337},"Overview","i-heroicons-play","\u002Fdocs\u002Foverview","docs\u002F1.overview",[318,321,325,329,333],{"title":319,"path":18,"stem":320},"Introduction","docs\u002F1.overview\u002F1.introduction",{"title":322,"path":323,"stem":324},"Installation","\u002Fdocs\u002Foverview\u002Finstallation","docs\u002F1.overview\u002F2.installation",{"title":326,"path":327,"stem":328},"First Steps","\u002Fdocs\u002Foverview\u002Ffirst-steps","docs\u002F1.overview\u002F3.first-steps",{"title":330,"path":331,"stem":332},"What's Next","\u002Fdocs\u002Foverview\u002Fwhats-next","docs\u002F1.overview\u002F4.whats-next",{"title":334,"path":335,"stem":336},"Ecosystem","\u002Fdocs\u002Foverview\u002Fecosystem","docs\u002F1.overview\u002F5.ecosystem",false,{"title":339,"icon":340,"path":341,"stem":342,"children":343,"page":337},"Features","i-heroicons-sparkles-solid","\u002Fdocs\u002Ffeatures","docs\u002F2.features",[344,348,352,356,360,364],{"title":345,"path":346,"stem":347},"Robust Geometry Kernel","\u002Fdocs\u002Ffeatures\u002Fgeometry","docs\u002F2.features\u002F1.geometry",{"title":349,"path":350,"stem":351},"Flexible Data Models","\u002Fdocs\u002Ffeatures\u002Fdata","docs\u002F2.features\u002F2.data",{"title":353,"path":354,"stem":355},"Interoperability Across Tools","\u002Fdocs\u002Ffeatures\u002Finterop","docs\u002F2.features\u002F3.interop",{"title":357,"path":358,"stem":359},"Cross Platform","\u002Fdocs\u002Ffeatures\u002Fcross-platform","docs\u002F2.features\u002F4.cross-platform",{"title":361,"path":362,"stem":363},"Modular Extension Ecosystem","\u002Fdocs\u002Ffeatures\u002Fextensions","docs\u002F2.features\u002F5.extensions",{"title":300,"path":301,"stem":302},{"title":291,"icon":366,"path":367,"stem":368,"children":369,"page":337},"i-heroicons-beaker","\u002Fdocs\u002Fexamples","docs\u002F3.examples",[370,371,372],{"title":59,"path":293,"stem":295},{"title":304,"path":305,"stem":306},{"title":373,"path":374,"stem":375},"Planes and frames","\u002Fdocs\u002Fexamples\u002Fplanes-and-frames","docs\u002F3.examples\u002F3.planes-and-frames",{"title":377,"icon":378,"path":379,"stem":380,"children":381,"page":337},"Cite & Credit","i-heroicons-academic-cap","\u002Fdocs\u002Fcite","docs\u002F4.cite",[382],{"title":383,"path":384,"stem":385},"Show it on your project","\u002Fdocs\u002Fcite\u002Fshow-it-on-your-project","docs\u002F4.cite\u002F1.show-it-on-your-project",1791766077003]