.\" Automatically generated by Pandoc 2.9.2.1
.\"
.TH "rtcNewGeometry" "3" "" "" "Embree Ray Tracing Kernels 4"
.hy
.SS NAME
.IP
.nf
\f[C]
rtcNewGeometry - creates a new geometry object
\f[R]
.fi
.SS SYNOPSIS
.IP
.nf
\f[C]
#include <embree4/rtcore.h>

enum RTCGeometryType
{
 RTC_GEOMETRY_TYPE_TRIANGLE,
 RTC_GEOMETRY_TYPE_QUAD,
 RTC_GEOMETRY_TYPE_SUBDIVISION,
 RTC_GEOMETRY_TYPE_FLAT_LINEAR_CURVE,
 RTC_GEOMETRY_TYPE_FLAT_BEZIER_CURVE,
 RTC_GEOMETRY_TYPE_FLAT_BSPLINE_CURVE,
 RTC_GEOMETRY_TYPE_FLAT_HERMITE_CURVE,
 RTC_GEOMETRY_TYPE_FLAT_CATMULL_ROM_CURVE,
 RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_BEZIER_CURVE,
 RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_BSPLINE_CURVE,
 RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_HERMITE_CURVE,
 RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_CATMULL_ROM_CURVE,
 RTC_GEOMETRY_TYPE_CONE_LINEAR_CURVE,
 RTC_GEOMETRY_TYPE_ROUND_LINEAR_CURVE,
 RTC_GEOMETRY_TYPE_ROUND_BEZIER_CURVE,
 RTC_GEOMETRY_TYPE_ROUND_BSPLINE_CURVE,
 RTC_GEOMETRY_TYPE_ROUND_HERMITE_CURVE,
 RTC_GEOMETRY_TYPE_ROUND_CATMULL_ROM_CURVE,
 RTC_GEOMETRY_TYPE_GRID,
 RTC_GEOMETRY_TYPE_SPHERE_POINT,
 RTC_GEOMETRY_TYPE_DISC_POINT,
 RTC_GEOMETRY_TYPE_ORIENTED_DISC_POINT,
 RTC_GEOMETRY_TYPE_USER,
 RTC_GEOMETRY_TYPE_INSTANCE,
 RTC_GEOMETRY_TYPE_INSTANCE_ARRAY,
};

RTCGeometry rtcNewGeometry(
  RTCDevice device,
  enum RTCGeometryType type
);
\f[R]
.fi
.SS DESCRIPTION
.PP
Geometries are objects that represent an array of primitives of the same
type.
The \f[C]rtcNewGeometry\f[R] function creates a new geometry of
specified type (\f[C]type\f[R] argument) bound to the specified device
(\f[C]device\f[R] argument) and returns a handle to this geometry.
The geometry object is reference counted with an initial reference count
of 1.
The geometry handle can be released using the
\f[C]rtcReleaseGeometry\f[R] API call.
.PP
Supported geometry types are triangle meshes
(\f[C]RTC_GEOMETRY_TYPE_TRIANGLE\f[R] type), quad meshes (triangle
pairs) (\f[C]RTC_GEOMETRY_TYPE_QUAD\f[R] type), Catmull-Clark
subdivision surfaces (\f[C]RTC_GEOMETRY_TYPE_SUBDIVISION\f[R] type),
curve geometries with different bases
(\f[C]RTC_GEOMETRY_TYPE_FLAT_LINEAR_CURVE\f[R],
\f[C]RTC_GEOMETRY_TYPE_FLAT_BEZIER_CURVE\f[R],
.PD 0
.P
.PD
\f[C]RTC_GEOMETRY_TYPE_FLAT_BSPLINE_CURVE\f[R],
\f[C]RTC_GEOMETRY_TYPE_FLAT_HERMITE_CURVE\f[R],
.PD 0
.P
.PD
\f[C]RTC_GEOMETRY_TYPE_FLAT_CATMULL_ROM_CURVE\f[R],
\f[C]RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_BEZIER_CURVE\f[R],
\f[C]RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_BSPLINE_CURVE\f[R],
\f[C]RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_HERMITE_CURVE\f[R],
\f[C]RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_CATMULL_ROM_CURVE\f[R],
\f[C]RTC_GEOMETRY_TYPE_CONE_LINEAR_CURVE\f[R],
\f[C]RTC_GEOMETRY_TYPE_ROUND_LINEAR_CURVE\f[R],
\f[C]RTC_GEOMETRY_TYPE_ROUND_BEZIER_CURVE\f[R],
\f[C]RTC_GEOMETRY_TYPE_ROUND_BSPLINE_CURVE\f[R],
\f[C]RTC_GEOMETRY_TYPE_ROUND_HERMITE_CURVE\f[R],
\f[C]RTC_GEOMETRY_TYPE_ROUND_CATMULL_ROM_CURVE\f[R] types) grid meshes
(\f[C]RTC_GEOMETRY_TYPE_GRID\f[R]), point geometries
(\f[C]RTC_GEOMETRY_TYPE_SPHERE_POINT\f[R],
\f[C]RTC_GEOMETRY_TYPE_DISC_POINT\f[R],
\f[C]RTC_TYPE_ORIENTED_DISC_POINT\f[R]), user-defined geometries
(\f[C]RTC_GEOMETRY_TYPE_USER\f[R]), instances
(\f[C]RTC_GEOMETRY_TYPE_INSTANCE\f[R]), and instance arrays
(\f[C]RTC_GEOMETRY_TYPE_INSTANCE_ARRAY\f[R]).
.PP
The types \f[C]RTC_GEOMETRY_TYPE_ROUND_BEZIER_CURVE\f[R],
\f[C]RTC_GEOMETRY_TYPE_ROUND_BSPLINE_CURVE\f[R], and
\f[C]RTC_GEOMETRY_TYPE_ROUND_CATMULL_ROM_CURVE\f[R] will treat the curve
as a sweep surface of a varying-radius circle swept tangentially along
the curve.
The types \f[C]RTC_GEOMETRY_TYPE_FLAT_BEZIER_CURVE\f[R],
\f[C]RTC_GEOMETRY_TYPE_FLAT_BSPLINE_CURVE\f[R], and
\f[C]RTC_GEOMETRY_TYPE_FLAT_CATMULL_ROM_CURVE\f[R] use ray-facing
ribbons as a faster-to-intersect approximation.
.PP
After construction, geometries are enabled by default and not attached
to any scene.
Geometries can be disabled (\f[C]rtcDisableGeometry\f[R] call), and
enabled again (\f[C]rtcEnableGeometry\f[R] call).
A geometry can be attached to multiple scenes using the
\f[C]rtcAttachGeometry\f[R] call (or \f[C]rtcAttachGeometryByID\f[R]
call), and detached using the \f[C]rtcDetachGeometry\f[R] call.
During attachment, a geometry ID is assigned to the geometry (or
assigned by the user when using the \f[C]rtcAttachGeometryByID\f[R]
call), which uniquely identifies the geometry inside that scene.
This identifier is returned when primitives of the geometry are hit in
later ray queries for the scene.
.PP
Geometries can also be modified, including their vertex and index
buffers.
After modifying a buffer, \f[C]rtcUpdateGeometryBuffer\f[R] must be
called to notify that the buffer got modified.
.PP
The application can use the \f[C]rtcSetGeometryUserData\f[R] function to
set a user data pointer to its own geometry representation, and later
read out this pointer using the \f[C]rtcGetGeometryUserData\f[R]
function.
.PP
After setting up the geometry or modifying it,
\f[C]rtcCommitGeometry\f[R] must be called to finish the geometry setup.
After committing the geometry, vertex data interpolation can be
performed using the \f[C]rtcInterpolate\f[R] and
\f[C]rtcInterpolateN\f[R] functions.
.PP
A build quality can be specified for a geometry using the
\f[C]rtcSetGeometryBuildQuality\f[R] function, to balance between
acceleration structure build performance and ray query performance.
The build quality per geometry will be used if a two-level acceleration
structure is built internally, which is the case if the
\f[C]RTC_BUILD_QUALITY_LOW\f[R] is set as the scene build quality.
See Section [rtcSetSceneBuildQuality] for more details.
.SS EXIT STATUS
.PP
On failure \f[C]NULL\f[R] is returned and an error code is set that can
be queried using \f[C]rtcGetDeviceError\f[R].
.SS SEE ALSO
.PP
[rtcEnableGeometry], [rtcDisableGeometry], [rtcAttachGeometry],
[rtcAttachGeometryByID], [rtcUpdateGeometryBuffer],
[rtcSetGeometryUserData], [rtcGetGeometryUserData], [rtcCommitGeometry],
[rtcInterpolate], [rtcInterpolateN], [rtcSetGeometryBuildQuality],
[rtcSetSceneBuildQuality], [RTC_GEOMETRY_TYPE_TRIANGLE],
[RTC_GEOMETRY_TYPE_QUAD], [RTC_GEOMETRY_TYPE_SUBDIVISION],
[RTC_GEOMETRY_TYPE_CURVE], [RTC_GEOMETRY_TYPE_GRID],
[RTC_GEOMETRY_TYPE_POINT], [RTC_GEOMETRY_TYPE_USER],
[RTC_GEOMETRY_TYPE_INSTANCE], [RTC_GEOMETRY_TYPE_INSTANCE_ARRAY]
