Repository navigation
Engineering views
extensions/visual/ draws engineering results. MeshBuilder builds walls, pipes and ground as one geometry. Overlay draws text, labels, leader lines, arrows and color bars on a rendered frame. The textures give formed concrete, soil and riprap. Retaining walls gives the analysis that these views show.
| Module | What it gives |
|---|---|
mesh |
MeshBuilder: triangle, smooth_triangle, quad, oriented, prism, loft, plate, tube, heightfield and geometry
|
overlay |
Overlay with text, text_width and label, and fill_polygons, fill_rect, stroke_line, fill_disc and arrow
|
textures |
formed_concrete_maps, soil_maps and riprap_maps
|
MeshBuilder takes points in a z-up frame in meters: x east, y north, z up. It turns them into the y-up frame that three.js draws in. Texture coordinates are world meters, projected along the axis that the face is most nearly normal to. A texture that repeats every n meters has the same scale on every face.
-
prismextrudes a section polygon along a straight run. -
loftsweeps a section between two placements. Use it for a mitered corner or a sloping top. -
platemakes a flat slab with holes through it, for example a headwall with pipe openings. -
tubemakes a round pipe barrel, solid or hollow. -
heightfieldmakes a smooth surface over a grid of heights.
var mb = MeshBuilder()
mb.prism([(0.0, 0.0), (3.0, 0.0), (3.0, 0.5), (0.0, 0.5)], Vec3d(0, 0, 0), Vec3d(0, 5, 0), Vec3d(1, 0, 0), Vec3d(1, 1, 1))
var geometry = mb.geometry()Overlay.from_ttf loads a TrueType font. text draws one line at a baseline, anchored LEFT, CENTER or RIGHT. label draws lines of text on a box, with an optional colored bar. Every shape is filled by the even-odd rule with 4 by 4 samples per pixel, then blended over the frame.
Use the camera's project to put a world point on the frame. Then draw a leader line from the label to the point.
The overlay fills every contour of a glyph by the even-odd rule. It does not sort the contours into shapes with holes. A font can list a hole before its outline, as DejaVu Sans does for "8". The to_shapes method of ShapePath keeps the three.js behavior and drops such a hole. The overlay draws it correctly.
- The overlay draws in sRGB bytes. It does not tone map.
- Text is one line per call.
labelstacks lines.
Tutorials
How-to
Reference
- Scene graph
- Rotations
- Cameras
- Geometry
- Geometry addons
- Lofts and clipping groups
- Sculptor
- Procedural generators
- Meshes and assets
- Lines
- Points and sprites
- Helpers
- Scene objects
- Animated objects
- Raycasting
- Curves and paths
- Animation
- Skinning
- Materials
- Node materials
- TSL functions
- Lights
- Lighting addons
- Fog
- Textures
- Renderer
- Renderer hooks and material flags
- Rasterization
- GPU backend
- Render target
- Post-processing
- GPU computation
- Compute nodes
- Progressive light map
- Gaussian splats
- Voxel global illumination
- SVG renderer
- Image files
- Image decode queue
- Model files
- More model files
- Exporters
- Scene JSON
- Windowing and controls
- Math
- Norm consumers
- Math addons
- Units
- Coverage tool
- Commands
- Examples
- Benchmarks
- Extensions
- Shared physics
- Physics query snapshots
- Continuous collision
- Tick force restoration
- Water
- Streamline
- Animals
- Buildings
- CARLA
- Femur
- Tibia
- Fibula
- Patella
- Knee
- Muscles
- Vessels
- Lymph
- Nerves
- Integument
- Leg
- Foot
- Pelvis
- Torso
- Arm
- Hand
- Head
- Genome
- Game humanoid
- Humanoid fidelity
- Audio-aligned game faces
- Converted assets
- Mesh quality
- Segment inertia
Explanation
- Software rasterizer
- Scene graph as an array
- Linear color
- Normals are not colors
- Perspective correction
- Fixed-point coverage
- Per-fragment shading
- Mipmaps
- Sorted transparency
- Types and checks
- Render hooks as a trait
- Shared CPU and GPU code
- Bands and threads
- PNG structure
- Extensions beside the port
- CUDA teardown hang
- Mojo compiler hang