Object 3D
# Independently editable objects; 3D rotation never changes their layout boxes.p=canvas(size=(170mm,120mm),background="#f5f7fb",stylesheet="@laymesh/effects.css")p.add(text("Shape, type & image",font_size=7mm,color="#18324d"),offset=(9mm,7mm))p.add(text("Shared geometry · local depth · editable source",font_size=3mm,color="#61738c"),offset=(9mm,19mm))p.add(rect(size=(34mm,20mm),border_radius=3mm,class="fx-bevel-button"),offset=(15mm,35mm))p.add(text("OB8",font_family="../../tests/fonts/DejaVuSans.ttf",font_size=15mm,text_fill="#278f9f",text_stroke_width=0.25mm,text_stroke_color="#1d536c",three_d=three_d(depth=3mm,rotation=(15deg,-28deg,0deg)),effects=[reflection(distance=1mm,length=0.6,opacity=0.35)]),offset=(70mm,34mm))p.add(text("Bevel / top and bottom",font_size=3mm,color="#61738c"),offset=(12mm,62mm))p.add(text("Glyph holes / stroke / reflection",font_size=3mm,color="#61738c"),offset=(70mm,62mm))p.add(formula(r"\frac{x^2+1}{\sqrt{y}}",font_size=23pt,color="#5c68a4",three_d=three_d(depth=1mm,rotation=(20deg,-25deg,0deg))),offset=(13mm,78mm))p.add(text("中文",font_family="../../tests/fonts/text/CJK-Regular.otf",font_size=11mm,color="#b57947",three_d=three_d(depth=2mm,rotation=(15deg,-35deg,0deg))),offset=(53mm,81mm))p.add(image(src="../gallery/assets/sample.png",size=(40mm,25mm),border_radius=3mm,three_d=three_d(depth=2mm,rotation=(20deg,-30deg,0deg),projection="perspective",distance=100mm)),crop=box(offset=(0.15,0.1),size=(0.7,0.8)),offset=(113mm,76mm))p.add(text("Formula",font_size=3mm,color="#61738c"),offset=(13mm,108mm))p.add(text("Chinese",font_size=3mm,color="#61738c"),offset=(53mm,108mm))p.add(text("Cropped texture / rounded rim",font_size=3mm,color="#61738c"),offset=(107mm,108mm))Preview
Background
Preparing preview…
Dependencies
examples/effects/object-3d.layexamples/gallery/assets/sample.png
Reproduce
laymesh validate examples/effects/object-3d.laylaymesh render examples/effects/object-3d.lay -o figure.svglaymesh render examples/effects/object-3d.lay -o figure.pdflaymesh render examples/effects/object-3d.lay -o figure.png --dpi 300