Construct an indexed sweep with independent geometry, normal, and texture indices. Geometry construction is independent of any renderer.
extruded_path_mesh(
points,
polygon = NA,
polygon_end = NA,
breaks = NA,
closed = FALSE,
closed_smooth = TRUE,
polygon_add_points = 0,
twists = 0,
texture_repeats = 1,
straight = FALSE,
precomputed_control_points = FALSE,
width = 1,
width_end = NA,
width_ease = "spline",
smooth_normals = FALSE,
u_min = 0,
u_max = 1,
linear_step = FALSE,
end_caps = c(TRUE, TRUE),
initial_normal = NULL,
smooth_angle = 180,
arc_tolerance = 1e-05,
position = c(0, 0, 0),
scale = c(1, 1, 1),
angle = c(0, 0, 0),
pivot_point = c(0, 0, 0),
order_rotation = c(1, 2, 3),
material = material_list(),
material_caps = NULL,
separate_caps = FALSE
)Matrix or data frame with three columns, or a list of numeric three-vectors, describing the path. With precomputed controls, a list of four-by-three cubic Bezier control-point matrices.
Default NA. Cross-section accepted by xy.coords();
defaults to a 30-sided circle with diameter one. Must be a simple polygon
without holes. A repeated closing vertex is removed.
Default NA. Optional final profile with the same number
of vertices. Corresponding rows are interpolated along the full path.
Default NA. Samples along the full path, including endpoints;
defaults to 20 times the number of Bezier segments. Exact trim endpoints and
polyline corners are inserted as needed.
Default FALSE. Close the path and align its end frames.
Default TRUE. Use C2-continuous periodic interpolation
for a closed smooth path. Otherwise its closing segment has C1 continuity.
Ignored for straight paths and precomputed controls.
Default 0. Number of points to insert per
profile edge before sweeping.
Default 0. Number of full profile rotations over the path.
Default 1. Texture repetitions along the full path.
Default FALSE. Connect points with straight segments.
Default FALSE. Interpret points as
cubic Bezier controls instead of interpolation points.
Default 1. Nonnegative profile scale, or numeric width values
spaced evenly along the path. An xy.coords() representation supplies
explicit positions from zero to one and widths. Zero-width rings form triangle fans.
Default NA. Final width when width is a scalar;
otherwise ignored. Defaults to the initial width.
Default "spline". Shape-preserving cubic interpolation
between widths. Other choices are linear, quad, cubic, and exp.
Default FALSE. Include surface normals accounting
for taper, twist, and changing profiles. Cap normals remain hard.
Default 0. Start of the retained path interval. Closed paths
can wrap across their seam.
Default 1. End of the retained path interval. A full closed
interval has no caps. Equal endpoints produce an empty mesh.
Default FALSE. Interpret path coordinates as normalized
arc length using adaptive sampling instead of Bezier parameter distance.
Default c(TRUE, TRUE). Include the starting and ending caps.
Default NULL. Initial direction of the profile's
positive X axis, projected perpendicular to the path tangent. Must not be
parallel to that tangent. By default curvature or a stable axis is used.
Default 180. Maximum profile turning angle in degrees
to smooth. Smaller values preserve corners when smooth_normals = TRUE.
Default 1e-5. Relative adaptive sampling tolerance,
measured against the total control-polygon length.
Default c(0, 0, 0). Translation of the completed mesh.
Default c(1, 1, 1). Scale of the mesh, uniformly or per axis.
Default c(0, 0, 0). Rotation angles in degrees.
Default c(0, 0, 0). Point around which to rotate.
Default c(1, 2, 3). Order to rotate the axes.
Default material_list(). Surface material.
Default NULL. Cap material; defaults to material.
Default FALSE. Return surfaces and caps separately
for independent editing or material assignment by another renderer.
A ray_mesh, or NULL for an empty interval or entirely zero-width
sweep. With separate_caps = TRUE, a list with surface and caps entries,
each containing a ray_mesh or NULL.
Closed sweeps correct accumulated frame rotation. Full loops and intervals crossing the seam require compatible endpoint profiles, widths, and twists. For example, a square profile permits quarter-turn seam rotations. Invalid seams raise an error. Profile winding is normalized while retaining the first vertex. Texture seams and shading creases use separate attribute indices.