Class ParStreamlines
- java.lang.Object
-
- org.lwjgl.util.par.ParStreamlines
-
public class ParStreamlines extends java.lang.Object
Bindings to par_streamlines.h, a single-file, zero-dependency, C99 library that can triangulate wide lines and curves.
-
-
Field Summary
Fields Modifier and Type Field Description static int
PAR_U_MODE_DISTANCE
PAR_U_MODE_NORMALIZED_DISTANCE
PAR_U_MODE_SEGMENT_FRACTION
PAR_U_MODE_SEGMENT_INDEXConfigures how the library assigns UV coordinates.static int
PARSL_FLAG_ANNOTATIONS
Populatesmesh.annotations
static int
PARSL_FLAG_CURVE_GUIPARSL_FLAG_DES
Draws control pointsstatic int
PARSL_FLAG_RANDOM_OFFSETS
Populatesmesh.random_offsets
static int
PARSL_FLAG_SPINE_LENGTHS
Populatesmesh.lengths
static int
PARSL_FLAG_WIREFRAME
Enables 4 indices per triangle
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static long
nparsl_create_context(long config)
static void
nparsl_destroy_context(long ctx)
static long
nparsl_mesh_from_curves_cubic(long context, long spines)
Unsafe version of:mesh_from_curves_cubic
static long
nparsl_mesh_from_curves_quadratic(long context, long spines)
Unsafe version of:mesh_from_curves_quadratic
static long
nparsl_mesh_from_lines(long ctx, long spines)
Unsafe version of:mesh_from_lines
static long
nparsl_mesh_from_streamlines(long context, long advect, int first_tick, int num_ticks, long userdata)
Unsafe version of:mesh_from_streamlines
static long
parsl_create_context(ParSLConfig config)
static void
parsl_destroy_context(long ctx)
static ParSLMesh
parsl_mesh_from_curves_cubic(long context, ParSLSpineList spines)
High-level function that tessellates a series of curves into triangles, where each spine is a series of chained cubic Bézier curves.static ParSLMesh
parsl_mesh_from_curves_quadratic(long context, ParSLSpineList spines)
High-level function that tessellates a series of curves into triangles, where each spine is a series of chained quadratic Bézier curves.static ParSLMesh
parsl_mesh_from_lines(long ctx, ParSLSpineList spines)
Low-level function that generates two triangles for each line segment.static ParSLMesh
parsl_mesh_from_streamlines(long context, ParSLAdvectionCallbackI advect, int first_tick, int num_ticks, long userdata)
High-level function that can be used to visualize a vector field.
-
-
-
Field Detail
-
PAR_U_MODE_NORMALIZED_DISTANCE, PAR_U_MODE_DISTANCE, PAR_U_MODE_SEGMENT_INDEX, PAR_U_MODE_SEGMENT_FRACTION
Configures how the library assigns UV coordinates.Enum values:
PAR_U_MODE_NORMALIZED_DISTANCE
- This is the default.PAR_U_MODE_DISTANCE
- Non-normalized distance along the curve.PAR_U_MODE_SEGMENT_INDEX
- Starts at zero for each curve, counts up.PAR_U_MODE_SEGMENT_FRACTION
- 0.0, 1.0 / COUNT, 2.0 / COUNT, etc...
-
PARSL_FLAG_WIREFRAME
Enables 4 indices per triangle
-
PARSL_FLAG_ANNOTATIONS
Populatesmesh.annotations
-
PARSL_FLAG_SPINE_LENGTHS
Populatesmesh.lengths
-
PARSL_FLAG_RANDOM_OFFSETS
Populatesmesh.random_offsets
-
PARSL_FLAG_CURVE_GUIPARSL_FLAG_DES
Draws control points
-
-
Method Detail
-
nparsl_create_context
public static long nparsl_create_context(long config)
-
parsl_create_context
public static long parsl_create_context(ParSLConfig config)
-
nparsl_destroy_context
public static void nparsl_destroy_context(long ctx)
-
parsl_destroy_context
public static void parsl_destroy_context(long ctx)
-
nparsl_mesh_from_lines
public static long nparsl_mesh_from_lines(long ctx, long spines)
Unsafe version of:mesh_from_lines
-
parsl_mesh_from_lines
@Nullable public static ParSLMesh parsl_mesh_from_lines(long ctx, ParSLSpineList spines)
Low-level function that generates two triangles for each line segment.
-
nparsl_mesh_from_streamlines
public static long nparsl_mesh_from_streamlines(long context, long advect, int first_tick, int num_ticks, long userdata)
Unsafe version of:mesh_from_streamlines
-
parsl_mesh_from_streamlines
@Nullable public static ParSLMesh parsl_mesh_from_streamlines(long context, ParSLAdvectionCallbackI advect, int first_tick, int num_ticks, long userdata)
High-level function that can be used to visualize a vector field.
-
nparsl_mesh_from_curves_cubic
public static long nparsl_mesh_from_curves_cubic(long context, long spines)
Unsafe version of:mesh_from_curves_cubic
-
parsl_mesh_from_curves_cubic
@Nullable public static ParSLMesh parsl_mesh_from_curves_cubic(long context, ParSLSpineList spines)
High-level function that tessellates a series of curves into triangles, where each spine is a series of chained cubic Bézier curves.The first curve of each spine is defined by an endpoint, followed by two control points, followed by an endpoint. Every subsequent curve in the spine is defined by a single control point followed by an endpoint. Only one control point is required because the first control point is computed via reflection over the endpoint.
The number of vertices in each spine should be
4+(n-1)*2
wheren
is the number of piecewise curves.Each spine is equivalent to an SVG path that looks like
M C S S S
.
-
nparsl_mesh_from_curves_quadratic
public static long nparsl_mesh_from_curves_quadratic(long context, long spines)
Unsafe version of:mesh_from_curves_quadratic
-
parsl_mesh_from_curves_quadratic
@Nullable public static ParSLMesh parsl_mesh_from_curves_quadratic(long context, ParSLSpineList spines)
High-level function that tessellates a series of curves into triangles, where each spine is a series of chained quadratic Bézier curves.The first curve of each spine is defined by an endpoint, followed by one control point, followed by an endpoint. Every subsequent curve in the spine is defined by a single control point followed by an endpoint.
The number of vertices in each spine should be
3+(n-1)*2
wheren
is the number of piecewise curves.Each spine is equivalent to an SVG path that looks like
M Q M Q M Q
.
-
-