import{S as es,i as ss,s as ts,e as n,k as i,w as y,t as c,M as as,c as o,d as s,m as p,a as r,x as E,h as f,b as m,G as a,g as l,y as x,L as ls,q as j,o as k,B as S,v as ns}from"../../chunks/vendor-hf-doc-builder.js";import{I as Ze}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{C as G}from"../../chunks/CodeBlock-hf-doc-builder.js";function os(He){let h,Q,u,$,J,P,ve,R,_e,V,b,ge,T,we,ye,W,I,Ee,X,A,Z,O,xe,ee,B,se,v,je,F,ke,Se,te,_,Pe,q,Te,Ae,ae,C,le,g,Be,U,Fe,qe,ne,L,oe,d,w,z,N,Ce,K,Le,re,Y,Ne,ie,M,ce,D,Me,pe,H,fe;return P=new Ze({}),A=new G({props:{code:`import simulate as sm
scene = sm.Scene()`,highlighted:`<span class="hljs-keyword">import</span> simulate <span class="hljs-keyword">as</span> sm
<span class="hljs-title">scene</span> = sm.<span class="hljs-type">Scene</span>()`}}),B=new G({props:{code:`scene += sm.LightSun()
scene += sm.Box()`,highlighted:`scene += sm.LightSun()
scene += sm.Box()`}}),C=new G({props:{code:'scene.save("output/test.gltf")',highlighted:'<span class="hljs-built_in">scene</span>.<span class="hljs-built_in">save</span>(<span class="hljs-string">&quot;output/test.gltf&quot;</span>)'}}),L=new G({props:{code:"scene.show()",highlighted:'<span class="hljs-built_in">scene</span>.<span class="hljs-built_in">show</span>()'}}),N=new Ze({}),M=new G({props:{code:'scene = sm.Scene.create_from("simulate-tests/Box/glTF-Embedded/Box.gltf")',highlighted:'<span class="hljs-attribute">scene</span> <span class="hljs-operator">=</span> sm.Scene.create_from(<span class="hljs-string">&quot;simulate-tests/Box/glTF-Embedded/Box.gltf&quot;</span>)'}}),H=new G({props:{code:'scene += sm.Asset.create_from("simulate-tests/Box/glTF-Embedded/Box.gltf")',highlighted:'scene += sm<span class="hljs-selector-class">.Asset</span><span class="hljs-selector-class">.create_from</span>(<span class="hljs-string">&quot;simulate-tests/Box/glTF-Embedded/Box.gltf&quot;</span>)'}}),{c(){h=n("meta"),Q=i(),u=n("h1"),$=n("a"),J=n("span"),y(P.$$.fragment),ve=i(),R=n("span"),_e=c("Creating a scene"),V=i(),b=n("p"),ge=c("This section describes how to create and save a simple scene. The code in this section is reflected in "),T=n("a"),we=c("examples/basic/create_and_save.py"),ye=c("."),W=i(),I=n("p"),Ee=c("Start by creating an empty scene:"),X=i(),y(A.$$.fragment),Z=i(),O=n("p"),xe=c("Then, add a light source and a box to the scene:"),ee=i(),y(B.$$.fragment),se=i(),v=n("p"),je=c("A full list of available built-in objects can be found "),F=n("a"),ke=c("here"),Se=c("."),te=i(),_=n("p"),Pe=c("You can save the scene using the "),q=n("a"),Te=c("glTF 2.0"),Ae=c(" specification, allowing it to be shared across multiple platforms:"),ae=i(),y(C.$$.fragment),le=i(),g=n("p"),Be=c("Finally, call "),U=n("code"),Fe=c("show()"),qe=c(" to display the scene:"),ne=i(),y(L.$$.fragment),oe=i(),d=n("h2"),w=n("a"),z=n("span"),y(N.$$.fragment),Ce=i(),K=n("span"),Le=c("Loading scenes"),re=i(),Y=n("p"),Ne=c("Scenes can also be loaded from the hub:"),ie=i(),y(M.$$.fragment),ce=i(),D=n("p"),Me=c("or, they can be treated as individual assets, and added to the scene:"),pe=i(),y(H.$$.fragment),this.h()},l(e){const t=as('[data-svelte="svelte-1phssyn"]',document.head);h=o(t,"META",{name:!0,content:!0}),t.forEach(s),Q=p(e),u=o(e,"H1",{class:!0});var me=r(u);$=o(me,"A",{id:!0,class:!0,href:!0});var Ie=r($);J=o(Ie,"SPAN",{});var Oe=r(J);E(P.$$.fragment,Oe),Oe.forEach(s),Ie.forEach(s),ve=p(me),R=o(me,"SPAN",{});var Ye=r(R);_e=f(Ye,"Creating a scene"),Ye.forEach(s),me.forEach(s),V=p(e),b=o(e,"P",{});var he=r(b);ge=f(he,"This section describes how to create and save a simple scene. The code in this section is reflected in "),T=o(he,"A",{href:!0,rel:!0});var De=r(T);we=f(De,"examples/basic/create_and_save.py"),De.forEach(s),ye=f(he,"."),he.forEach(s),W=p(e),I=o(e,"P",{});var Ge=r(I);Ee=f(Ge,"Start by creating an empty scene:"),Ge.forEach(s),X=p(e),E(A.$$.fragment,e),Z=p(e),O=o(e,"P",{});var Je=r(O);xe=f(Je,"Then, add a light source and a box to the scene:"),Je.forEach(s),ee=p(e),E(B.$$.fragment,e),se=p(e),v=o(e,"P",{});var ue=r(v);je=f(ue,"A full list of available built-in objects can be found "),F=o(ue,"A",{href:!0,rel:!0});var Re=r(F);ke=f(Re,"here"),Re.forEach(s),Se=f(ue,"."),ue.forEach(s),te=p(e),_=o(e,"P",{});var de=r(_);Pe=f(de,"You can save the scene using the "),q=o(de,"A",{href:!0,rel:!0});var Ue=r(q);Te=f(Ue,"glTF 2.0"),Ue.forEach(s),Ae=f(de," specification, allowing it to be shared across multiple platforms:"),de.forEach(s),ae=p(e),E(C.$$.fragment,e),le=p(e),g=o(e,"P",{});var $e=r(g);Be=f($e,"Finally, call "),U=o($e,"CODE",{});var ze=r(U);Fe=f(ze,"show()"),ze.forEach(s),qe=f($e," to display the scene:"),$e.forEach(s),ne=p(e),E(L.$$.fragment,e),oe=p(e),d=o(e,"H2",{class:!0});var be=r(d);w=o(be,"A",{id:!0,class:!0,href:!0});var Ke=r(w);z=o(Ke,"SPAN",{});var Qe=r(z);E(N.$$.fragment,Qe),Qe.forEach(s),Ke.forEach(s),Ce=p(be),K=o(be,"SPAN",{});var Ve=r(K);Le=f(Ve,"Loading scenes"),Ve.forEach(s),be.forEach(s),re=p(e),Y=o(e,"P",{});var We=r(Y);Ne=f(We,"Scenes can also be loaded from the hub:"),We.forEach(s),ie=p(e),E(M.$$.fragment,e),ce=p(e),D=o(e,"P",{});var Xe=r(D);Me=f(Xe,"or, they can be treated as individual assets, and added to the scene:"),Xe.forEach(s),pe=p(e),E(H.$$.fragment,e),this.h()},h(){m(h,"name","hf:doc:metadata"),m(h,"content",JSON.stringify(rs)),m($,"id","creating-a-scene"),m($,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m($,"href","#creating-a-scene"),m(u,"class","relative group"),m(T,"href","https://github.com/huggingface/simulate/blob/main/examples/basic/create_and_save.py"),m(T,"rel","nofollow"),m(F,"href","https://github.com/huggingface/simulate/blob/main/examples/basic/objects.py"),m(F,"rel","nofollow"),m(q,"href","https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html"),m(q,"rel","nofollow"),m(w,"id","loading-scenes"),m(w,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(w,"href","#loading-scenes"),m(d,"class","relative group")},m(e,t){a(document.head,h),l(e,Q,t),l(e,u,t),a(u,$),a($,J),x(P,J,null),a(u,ve),a(u,R),a(R,_e),l(e,V,t),l(e,b,t),a(b,ge),a(b,T),a(T,we),a(b,ye),l(e,W,t),l(e,I,t),a(I,Ee),l(e,X,t),x(A,e,t),l(e,Z,t),l(e,O,t),a(O,xe),l(e,ee,t),x(B,e,t),l(e,se,t),l(e,v,t),a(v,je),a(v,F),a(F,ke),a(v,Se),l(e,te,t),l(e,_,t),a(_,Pe),a(_,q),a(q,Te),a(_,Ae),l(e,ae,t),x(C,e,t),l(e,le,t),l(e,g,t),a(g,Be),a(g,U),a(U,Fe),a(g,qe),l(e,ne,t),x(L,e,t),l(e,oe,t),l(e,d,t),a(d,w),a(w,z),x(N,z,null),a(d,Ce),a(d,K),a(K,Le),l(e,re,t),l(e,Y,t),a(Y,Ne),l(e,ie,t),x(M,e,t),l(e,ce,t),l(e,D,t),a(D,Me),l(e,pe,t),x(H,e,t),fe=!0},p:ls,i(e){fe||(j(P.$$.fragment,e),j(A.$$.fragment,e),j(B.$$.fragment,e),j(C.$$.fragment,e),j(L.$$.fragment,e),j(N.$$.fragment,e),j(M.$$.fragment,e),j(H.$$.fragment,e),fe=!0)},o(e){k(P.$$.fragment,e),k(A.$$.fragment,e),k(B.$$.fragment,e),k(C.$$.fragment,e),k(L.$$.fragment,e),k(N.$$.fragment,e),k(M.$$.fragment,e),k(H.$$.fragment,e),fe=!1},d(e){s(h),e&&s(Q),e&&s(u),S(P),e&&s(V),e&&s(b),e&&s(W),e&&s(I),e&&s(X),S(A,e),e&&s(Z),e&&s(O),e&&s(ee),S(B,e),e&&s(se),e&&s(v),e&&s(te),e&&s(_),e&&s(ae),S(C,e),e&&s(le),e&&s(g),e&&s(ne),S(L,e),e&&s(oe),e&&s(d),S(N),e&&s(re),e&&s(Y),e&&s(ie),S(M,e),e&&s(ce),e&&s(D),e&&s(pe),S(H,e)}}}const rs={local:"creating-a-scene",sections:[{local:"loading-scenes",title:"Loading scenes"}],title:"Creating a scene"};function is(He){return ns(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ms extends es{constructor(h){super();ss(this,h,is,os,ts,{})}}export{ms as default,rs as metadata};
