Script: 3D Text Cutout Blockly

3D Text Cutout Blockly picture
Type
Blockly logo indicatorblockly
Author
matas
Date Created
Sep 18, 2023, 3:20:58 PM
Last Edit Date
Feb 27, 2024, 4:02:44 PM

Project Information

Example script on how to use boolean difference opertaion on 3D text to cut it out from a solid shape.

View Full Project

Script Code

<xml xmlns="https://developers.google.com/blockly/xml">
 <variables>
  <variable id="{b}jwL]H5TGiQ*0EaYl[">text</variable>
 </variables>
 <block type="base_time_async_context" id="yBGCxieS~Jr`Q%^uGOKw" x="-586" y="113">
  <statement name="Then">
   <block type="variables_set" id="r8bK]n2gF-LUWr2(J_.f">
    <field name="VAR" id="{b}jwL]H5TGiQ*0EaYl[">text</field>
    <value name="VALUE">
     <block type="base_time_await_return" id="E.S%:0OtuHdlpiH)`nd#">
      <value name="Promise">
       <block type="bitbybit.advanced.text3d.create" id="#9qPS%H^7*-X1WR[7Qw`">
        <value name="Text">
         <block type="text" id="yf5__vmNdPsjL2tYoG~i">
          <field name="TEXT">bitbybit.dev</field>
         </block>
        </value>
        <value name="FontType">
         <block type="bitbybit.advanced.text3d.fontsEnum" id="(r1x-25TdQGSTelpdAg0">
          <field name="bitbybit.advanced.text3d.fontsEnum">'Roboto'</field>
         </block>
        </value>
        <value name="FontVariant">
         <block type="bitbybit.advanced.text3d.fontVariantsEnum" id="Q`W8Zgp2`@3yB*9O}ga}">
          <field name="bitbybit.advanced.text3d.fontVariantsEnum">'BoldItalic'</field>
         </block>
        </value>
        <value name="FontSize">
         <block type="math_number" id="WyW9X2XkDUNjU1=`K#Ql">
          <field name="NUM">3</field>
         </block>
        </value>
        <value name="Height">
         <block type="math_number" id="Bc2p`+As2kQo;^_2F~OT">
          <field name="NUM">3</field>
         </block>
        </value>
        <value name="Rotation">
         <block type="math_number" id="fNtlRZ(k+*(yRS$7q`QY">
          <field name="NUM">180</field>
         </block>
        </value>
        <value name="Origin">
         <block type="bitbybit.point.pointXYZ" id="bn^#n:|@%?7$TQ4iKd*4">
          <value name="X">
           <block type="math_number" id="^4OjiFI2],l4)#i!/%l2">
            <field name="NUM">8</field>
           </block>
          </value>
          <value name="Y">
           <block type="math_number" id="j,KOU6WV6Ci^h/6{k^wI">
            <field name="NUM">-2</field>
           </block>
          </value>
          <value name="Z">
           <block type="math_number" id="T1G0EDhD*mcd32p/h{k`">
            <field name="NUM">2</field>
           </block>
          </value>
         </block>
        </value>
        <value name="Direction">
         <block type="bitbybit.point.pointXYZ" id="or)30`ctk[W)G|3e]t[P">
          <value name="X">
           <block type="math_number" id="2L/8AUP#Bn%jPrUMwdG3">
            <field name="NUM">0</field>
           </block>
          </value>
          <value name="Y">
           <block type="math_number" id="n}STKF~2DUB9e*CBc#vm">
            <field name="NUM">1</field>
           </block>
          </value>
          <value name="Z">
           <block type="math_number" id="]vp+1Bk)GRXKCw.}#[ZT">
            <field name="NUM">0</field>
           </block>
          </value>
         </block>
        </value>
        <value name="OriginAlignment">
         <block type="bitbybit.advanced.text3d.recAlignmentEnum" id="L`u@c1WM)i[mZm^}-Vgb">
          <field name="bitbybit.advanced.text3d.recAlignmentEnum">'rightTop'</field>
         </block>
        </value>
       </block>
      </value>
     </block>
    </value>
    <next>
     <block type="bitbybit.draw.drawAnyAsyncNoReturn" id=".m,7FNnIkM0J:xGZRmsq">
      <value name="Entity">
       <block type="bitbybit.occt.booleans.difference" id="]kf/|0Nl{K}#F!}33bNM">
        <value name="Shape">
         <block type="bitbybit.occt.shapes.solid.createBox" id=",!Hj1]G3`nl/VA3K}4!X">
          <value name="Width">
           <block type="math_number" id="v@W6DB[S`:trcl5WhPxq">
            <field name="NUM">20</field>
           </block>
          </value>
          <value name="Length">
           <block type="math_number" id="XV*xj/+DjMTJT{S%)MrG">
            <field name="NUM">5</field>
           </block>
          </value>
          <value name="Height">
           <block type="math_number" id="oe2Yf,OY^0CcrGzlxa|K">
            <field name="NUM">1</field>
           </block>
          </value>
          <value name="Center">
           <block type="bitbybit.point.pointXYZ" id="BCY1zd*+GKi`)h_=?(.+">
            <value name="X">
             <block type="math_number" id="9a*b_;*O7PL!s6Oc$u`3">
              <field name="NUM">0</field>
             </block>
            </value>
            <value name="Y">
             <block type="math_number" id="mc`04EL7!o9`@oq~%S8S">
              <field name="NUM">0</field>
             </block>
            </value>
            <value name="Z">
             <block type="math_number" id="qK?_`8FSh`~GrS[lP){S">
              <field name="NUM">0</field>
             </block>
            </value>
           </block>
          </value>
         </block>
        </value>
        <value name="Shapes">
         <block type="bitbybit.json.query" id="|vLh_,-As{%X}/CeXvQ}">
          <value name="Json">
           <block type="variables_get" id="M%:8~0aYd_iQ;aBiK@I$">
            <field name="VAR" id="{b}jwL]H5TGiQ*0EaYl[">text</field>
           </block>
          </value>
          <value name="Query">
           <block type="text" id="@)d2])=?Z1]wj{fxlCUO">
            <field name="TEXT">$.compound</field>
           </block>
          </value>
         </block>
        </value>
        <value name="KeepEdges">
         <block type="logic_boolean" id="?VDavF:idJqK2V5s|4Eg">
          <field name="BOOL">FALSE</field>
         </block>
        </value>
       </block>
      </value>
     </block>
    </next>
   </block>
  </statement>
 </block>
</xml>