#![cfg_attr(
target_arch = "wasm32",
allow(clippy::arc_with_non_send_sync)
)]
#![allow(clippy::new_ret_no_self)]
pub mod animation;
#[cfg(feature = "assembly-check")]
pub mod assembly;
pub mod audio;
pub mod cameras;
#[cfg(feature = "captions")]
pub mod captions;
pub mod controls;
pub mod core;
pub mod curves;
pub mod extras;
pub mod geometries;
pub mod helpers;
pub mod kinematics;
pub mod origami;
pub mod lights;
pub mod loaders;
pub mod materials;
pub mod math;
pub mod postprocessing;
pub mod prelude;
pub mod renderers;
pub mod scene;
pub mod stats;
pub mod textures;
pub mod utils;
pub mod renderer;
#[cfg(target_arch = "wasm32")]
pub mod wasm;
#[cfg(all(target_arch = "wasm32", feature = "raytrace"))]
pub mod wasm_denoise;
#[cfg(all(feature = "metal", any(target_os = "macos", target_os = "ios")))]
pub mod metal;
#[cfg(all(feature = "videotoolbox", target_os = "macos"))]
pub mod videotoolbox;
#[cfg(feature = "mesh-bvh")]
pub mod mesh_bvh;
#[cfg(feature = "raytrace")]
pub mod raytrace;
#[cfg(feature = "bvh-csg")]
pub mod csg;
#[cfg(feature = "openscad")]
pub mod openscad;
#[cfg(feature = "planet")]
pub mod planet;
#[cfg(feature = "nurbs")]
pub mod nurbs;
#[cfg(feature = "brep")]
pub mod brep;
#[cfg(feature = "step")]
pub mod step;
#[cfg(feature = "openscad")]
pub mod exact_csg;
#[cfg(any(feature = "rlx", feature = "rlx-geo"))]
pub mod rlx;
#[cfg(target_arch = "wasm32")]
#[macro_export]
macro_rules! log {
($($t:tt)*) => {{
let s = format!($($t)*);
web_sys::console::log_1(&wasm_bindgen::JsValue::from_str(&s));
}};
}
#[cfg(not(target_arch = "wasm32"))]
#[macro_export]
macro_rules! log {
($($t:tt)*) => {{ eprintln!($($t)*); }};
}
pub use animation::{
AnimationAction, AnimationClip, AnimationMixer, Interpolation, KeyframeTrack, TrackTarget,
};
pub use audio::{Audio, AudioAnalyser, AudioBackend, AudioListener, NoopBackend, PositionalAudio};
#[cfg(feature = "brep")]
pub use brep::{retessellate, Surface, SurfaceTable};
pub use cameras::{Camera, OrthographicCamera, PerspectiveCamera};
#[cfg(feature = "captions")]
pub use captions::{
CaptionAlign, CaptionAnchor, CaptionError, CaptionFont, CaptionFormat, CaptionOverlay,
CaptionPainter, CaptionStyle, CaptionTrack, Cue,
};
pub use controls::{
ArcballControls, DragControls, FirstPersonControls, OrbitControls, PointerEvent,
PointerLockControls, TrackballControls,
};
pub use core::{
Bone, BufferAttribute, BufferGeometry, Clock, InstancedMesh, Intersection, Layers,
LineSegments, Mesh, MorphAttributes, MorphTarget, Object3D, ObjectArena, ObjectId, ObjectKind,
Points, Raycaster, Skeleton, SkinnedMesh, Sprite,
};
pub use curves::{
CatmullRomCurve3, CubicBezierCurve, CubicBezierCurve3, Curve2, Curve3, CurvePath, EllipseCurve,
LineCurve, LineCurve3, NURBSCurve, NURBSSurface, Path, QuadraticBezierCurve,
QuadraticBezierCurve3, Shape, SplineCurve,
};
pub use extras::{
CcdIkSolver, IkBone, MarchingCubes, Octree, PmremGenerator, SimplexNoise, PMREM_MIP_LEVELS,
};
#[cfg(feature = "nurbs")]
pub use geometries::NurbsGeometry;
pub use geometries::{
BoxGeometry, BoxLineGeometry, CapsuleGeometry, CircleGeometry, ConeGeometry, ConvexGeometry,
CylinderGeometry, DecalGeometry, DodecahedronGeometry, EdgesGeometry, ExtrudeGeometry, Glyph,
IcosahedronGeometry, Infill, KirigamiAssembly, KirigamiCell, KirigamiCoreLattice,
KirigamiCrease, KirigamiCreaseKind,
KirigamiExpandedMiura, KirigamiFace, KirigamiFaceKind, KirigamiMesh, KirigamiNet,
KirigamiNetPanel, KirigamiPreset, KIRIGAMI_NET_VARIANT, LatheGeometry, Lattice, LatticeGeometry, LatticeKind, LatticeStyle,
OctahedronGeometry, ParametricGeometry, PlaneGeometry, PolyhedronGeometry, Region,
RingGeometry, SphereGeometry, Strut, TetrahedronGeometry, TextGeometry, TorusGeometry,
TorusKnotGeometry, Tpms, TubeGeometry, WireframeGeometry, ChiralRule, Cuboct, CuboctAssembly,
CuboctAssemblyPlan, CuboctAssemblyStep, CuboctFrame, CuboctJoint, CuboctJointKind, FrameMaterial,
FrameResponse, Hand,
};
pub use helpers::{
ArrowHelper, AxesHelper, BoxHelper, CameraHelper, DirectionalLightHelper, GridHelper,
HemisphereLightHelper, PointLightHelper, PolarGridHelper, SkeletonHelper, SpotLightHelper,
VertexNormalsHelper, VertexTangentsHelper,
};
pub use origami::{
book_cardinal_cp, book_cardinal_stages, classic_bird_cp, classic_bird_stages, eagle_cp,
eagle_stages, frog_cp, frog_stages, giang_cardinal_cp, giang_cardinal_stages, AssembledBird,
Assignment, BirdKind, BookCardinalStage, ClassicBirdStage, ClosureReport, CreasePattern,
Degree4, EagleStage, Edge, EdgeKind, FoldedBirdPart, FoldedState, FrogStage, GiangCardinalStage,
PartPose, TWIST_ALPHA, VertexMode,
};
pub use lights::{
AmbientLight, DirectionalLight, HemisphereLight, Light, PointLight, RectAreaLight,
ShadowSettings, SpotLight,
};
pub use loaders::{
ColladaError, ColladaLoader, ExrError, ExrLoader, FbxError, FbxLoader, GltfError, GltfImages,
GltfLoader, GltfScene, HdrError, HdrLoader, ObjLoader, PlyLoader, StlLoader, TtfError, TtfFont,
TtfGlyph,
};
pub use materials::MirrorMaterial;
pub use materials::{
AtmosphereMaterial, BasicMaterial, DepthMaterial, LambertMaterial, LineBasicMaterial,
MatcapMaterial, Material, MaterialKind, MaterialTextureSlots, NormalMaterial, PhongMaterial,
PhysicalMaterial, PointsMaterial, ShaderMaterial, SpriteMaterial, StandardMaterial,
ToonMaterial, TransparencyMode,
};
pub use math::{
Box2, Box3, Color, Cylindrical, Euler, Frustum, Line3, Matrix3, Matrix4, Plane, Quaternion,
Ray, Sphere, Spherical, Triangle, Vector2, Vector3, Vector4,
};
#[cfg(feature = "nurbs")]
pub use nurbs::{NurbsCurve, NurbsSurface, TessellationOptions};
pub use postprocessing::{
BloomPass, CopyPass, EffectComposer, FilmPass, FxaaPass, GlitchPass, OutlinePass, Pass,
RenderPass, SsaoPass, SsrPass, ToneMappingPass,
};
#[cfg(not(target_arch = "wasm32"))]
pub use renderer::headless::{HeadlessBuilder, HeadlessConfig, HeadlessRenderer, MappedFrame};
pub use wgpu;
pub use renderer::{RenderTarget, Renderer, ToneMapping};
pub use renderers::{Css2dRenderer, Css3dRenderer, SvgRenderer};
pub use scene::Scene;
pub use stats::Stats;
pub use textures::{
pack_rgba16f, CubeTexture, DataTexture, DepthTexture, Texture, TextureFilter, TextureFormat,
TextureWrap,
};
pub use utils::png::{decode_png, encode_png, PngImage};
pub mod sequence;
pub use sequence::{
render_sequence, video_available, SequenceError, SequenceOptions, SequenceReport,
};
pub use utils::{
center as center_geometry, compute_tangents, compute_vertex_normals, merge_geometries,
scale as scale_geometry,
};
#[cfg(all(feature = "video", not(target_arch = "wasm32")))]
pub mod video;
#[cfg(all(feature = "video", not(target_arch = "wasm32")))]
pub use video::{
export_video, export_video_with_progress, format_video_progress, CaptionExport, CaptionMode,
VideoCodec, VideoError, VideoExportEvent, VideoExportPhase, VideoExportProgress, VideoExporter,
VideoOptions, VideoQuality,
};
#[cfg(feature = "native-codec")]
pub mod codec;
#[cfg(feature = "native-codec")]
pub use codec::animation::{
encode_animation_rgba, encode_animation_rgba_with_progress, format_animation_progress,
AnimationEncodeError, AnimationEncodeOptions, AnimationExportPhase, AnimationExportProgress,
BrowserCodec,
};
#[cfg(feature = "native-codec")]
pub use codec::apng::ApngEncoder;
#[cfg(feature = "native-codec")]
pub use codec::gif::{
decode_gif, encode_gif, DecodedFrame, DisposalMethod, DisposalMode, GifDecoder, GifEncoder,
GifError, GifFrameMeta, GifInfo, GifOptions, GifVersion, GifWriter, LzwClearMode, PaletteMode,
QuantizerKind,
};
#[cfg(feature = "native-codec")]
pub use codec::h264::{encode_mp4, encode_mp4_with_captions, H264Encoder};
#[cfg(feature = "native-codec")]
pub use codec::hevc::{HevcEncoder, TransparentEncoder, Yuv420Frame};
#[cfg(feature = "native-codec")]
pub use codec::vp9::{
encode_inter_frame, encode_inter_frame_altref, encode_inter_frame_compound,
encode_inter_frame_golden, encode_inter_frame_refresh, encode_inter_newmv_residual,
encode_inter_newmv_skip, encode_inter_residual, encode_inter_zeromv_skip, encode_intra_frame,
encode_intra_gray, Reconstruction,
};
#[cfg(feature = "native-codec")]
pub use codec::webm::{encode_gray_webm, encode_webm, mux_webm, WebmCodec, WebmFrame, WebmParams};
#[cfg(feature = "mesh-bvh")]
pub use mesh_bvh::{
BuildOptions as MeshBvhBuildOptions, BvhHit, MeshBvh, SerializedMeshBvh, AVERAGE, CENTER,
CONTAINED, INTERSECTED, NOT_INTERSECTED, SAH,
};
#[cfg(feature = "raytrace")]
pub use raytrace::{
Aov, BackgroundMode, CpuBackend, RaytraceBackend, RaytraceError, RaytraceRenderer,
RaytraceScene, RaytraceSettings,
};
#[cfg(feature = "bvh-csg")]
pub use csg::{
assert_step_verts, build_bvh_csg_hierarchy_geometry, evaluate_hierarchy, evaluate_live_through,
evaluate_through, js_target_verts, load_positions_geometry_bin, step1_shell_cut,
step2_add_sphere, step3_win_cut, step4_win_frame, CsgBrush, CsgEvaluator, CsgNode,
CsgOperation, CsgOperationGroup, ADDITION, DIFFERENCE, HOLLOW_INTERSECTION, HOLLOW_SUBTRACTION,
INTERSECTION, JS_STEP1_VERTS, JS_STEP2_VERTS, JS_STEP3_VERTS, JS_STEP4_VERTS,
REVERSE_SUBTRACTION, SUBTRACTION,
};
#[cfg(feature = "openscad")]
pub use exact_csg::report::{mesh_report, DefectCluster, MeshReport};
#[cfg(feature = "openscad")]
pub use openscad::export::{geometry_to_3mf, geometry_to_glb, geometry_to_obj, geometry_to_off, parts_to_glb};
#[cfg(feature = "openscad")]
pub use openscad::mechanism::{
DriveSpec, MateSpec, MateSpecKind, MechanismSpec, PartFit, PartSpec,
};
#[cfg(feature = "openscad")]
pub use openscad::scad::{
clear_files, parse_scad, parse_scad_at, parse_scad_file, parse_scad_file_at,
parse_scad_file_for_parts, parse_scad_file_with, parse_scad_mechanism, parse_scad_mechanism_at, parse_scad_mechanism_file,
parse_scad_mechanism_file_at, parse_scad_with, parse_scad_with_base, register_file,
scad_file_values, scad_value, scad_values, scad_values_in,
};
#[cfg(feature = "openscad")]
pub use openscad::schematic::{
schematic_project, schematic_project_view, schematic_to_rgba, schematic_to_svg, Schematic,
SchematicOptions, View,
};
#[cfg(feature = "openscad")]
pub use openscad::{build_nema17, build_printer};
#[cfg(feature = "openscad")]
pub use openscad::{
cone, cube, cylinder, difference_all, frustum, geometry_bounds, geometry_to_stl, hull,
intersection_all, linear_extrude, linear_extrude_holes, polyhedron, rotate_extrude,
rotate_extrude_fn, set_origin, solid, sphere, sphere_fn, union_all, Origin, Solid,
};
#[cfg(feature = "planet")]
pub use planet::{
generate_earth_maps, generate_starfield, Atmosphere, HeightField, MapBuffer, Planet,
PlanetHandles, PlanetMaps, Starfield,
};
#[cfg(all(feature = "planet", not(target_arch = "wasm32")))]
pub use planet::{EarthTextures, MapSources};