1rtcNewGeometry(3) Embree Ray Tracing Kernels 4 rtcNewGeometry(3)
2
3
4
5 NAME
6 rtcNewGeometry - creates a new geometry object
7
8 SYNOPSIS
9 #include <embree4/rtcore.h>
10
11 enum RTCGeometryType
12 {
13 RTC_GEOMETRY_TYPE_TRIANGLE,
14 RTC_GEOMETRY_TYPE_QUAD,
15 RTC_GEOMETRY_TYPE_SUBDIVISION,
16 RTC_GEOMETRY_TYPE_FLAT_LINEAR_CURVE,
17 RTC_GEOMETRY_TYPE_FLAT_BEZIER_CURVE,
18 RTC_GEOMETRY_TYPE_FLAT_BSPLINE_CURVE,
19 RTC_GEOMETRY_TYPE_FLAT_HERMITE_CURVE,
20 RTC_GEOMETRY_TYPE_FLAT_CATMULL_ROM_CURVE,
21 RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_BEZIER_CURVE,
22 RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_BSPLINE_CURVE,
23 RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_HERMITE_CURVE,
24 RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_CATMULL_ROM_CURVE,
25 RTC_GEOMETRY_TYPE_CONE_LINEAR_CURVE,
26 RTC_GEOMETRY_TYPE_ROUND_LINEAR_CURVE,
27 RTC_GEOMETRY_TYPE_ROUND_BEZIER_CURVE,
28 RTC_GEOMETRY_TYPE_ROUND_BSPLINE_CURVE,
29 RTC_GEOMETRY_TYPE_ROUND_HERMITE_CURVE,
30 RTC_GEOMETRY_TYPE_ROUND_CATMULL_ROM_CURVE,
31 RTC_GEOMETRY_TYPE_GRID,
32 RTC_GEOMETRY_TYPE_SPHERE_POINT,
33 RTC_GEOMETRY_TYPE_DISC_POINT,
34 RTC_GEOMETRY_TYPE_ORIENTED_DISC_POINT,
35 RTC_GEOMETRY_TYPE_USER,
36 RTC_GEOMETRY_TYPE_INSTANCE,
37 RTC_GEOMETRY_TYPE_INSTANCE_ARRAY,
38 };
39
40 RTCGeometry rtcNewGeometry(
41 RTCDevice device,
42 enum RTCGeometryType type
43 );
44
45 DESCRIPTION
46 Geometries are objects that represent an array of primitives of the
47 same type. The rtcNewGeometry function creates a new geometry of spec‐
48 ified type (type argument) bound to the specified device (device argu‐
49 ment) and returns a handle to this geometry. The geometry object is
50 reference counted with an initial reference count of 1. The geometry
51 handle can be released using the rtcReleaseGeometry API call.
52
53 Supported geometry types are triangle meshes (RTC_GEOMETRY_TYPE_TRIAN‐
54 GLE type), quad meshes (triangle pairs) (RTC_GEOMETRY_TYPE_QUAD type),
55 Catmull-Clark subdivision surfaces (RTC_GEOMETRY_TYPE_SUBDIVISION
56 type), curve geometries with different bases (RTC_GEOME‐
57 TRY_TYPE_FLAT_LINEAR_CURVE, RTC_GEOMETRY_TYPE_FLAT_BEZIER_CURVE,
58 RTC_GEOMETRY_TYPE_FLAT_BSPLINE_CURVE, RTC_GEOMETRY_TYPE_FLAT_HER‐
59 MITE_CURVE,
60 RTC_GEOMETRY_TYPE_FLAT_CATMULL_ROM_CURVE, RTC_GEOMETRY_TYPE_NORMAL_ORI‐
61 ENTED_BEZIER_CURVE, RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_BSPLINE_CURVE,
62 RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_HERMITE_CURVE, RTC_GEOMETRY_TYPE_NOR‐
63 MAL_ORIENTED_CATMULL_ROM_CURVE, RTC_GEOMETRY_TYPE_CONE_LINEAR_CURVE,
64 RTC_GEOMETRY_TYPE_ROUND_LINEAR_CURVE, RTC_GEOMETRY_TYPE_ROUND_BEZI‐
65 ER_CURVE, RTC_GEOMETRY_TYPE_ROUND_BSPLINE_CURVE, RTC_GEOME‐
66 TRY_TYPE_ROUND_HERMITE_CURVE, RTC_GEOMETRY_TYPE_ROUND_CATMULL_ROM_CURVE
67 types) grid meshes (RTC_GEOMETRY_TYPE_GRID), point geometries (RTC_GE‐
68 OMETRY_TYPE_SPHERE_POINT, RTC_GEOMETRY_TYPE_DISC_POINT, RTC_TYPE_ORI‐
69 ENTED_DISC_POINT), user-defined geometries (RTC_GEOMETRY_TYPE_USER),
70 instances (RTC_GEOMETRY_TYPE_INSTANCE), and instance arrays (RTC_GEOME‐
71 TRY_TYPE_INSTANCE_ARRAY).
72
73 The types RTC_GEOMETRY_TYPE_ROUND_BEZIER_CURVE, RTC_GEOME‐
74 TRY_TYPE_ROUND_BSPLINE_CURVE, and RTC_GEOMETRY_TYPE_ROUND_CAT‐
75 MULL_ROM_CURVE will treat the curve as a sweep surface of a varying-ra‐
76 dius circle swept tangentially along the curve. The types RTC_GEOME‐
77 TRY_TYPE_FLAT_BEZIER_CURVE, RTC_GEOMETRY_TYPE_FLAT_BSPLINE_CURVE, and
78 RTC_GEOMETRY_TYPE_FLAT_CATMULL_ROM_CURVE use ray-facing ribbons as a
79 faster-to-intersect approximation.
80
81 After construction, geometries are enabled by default and not attached
82 to any scene. Geometries can be disabled (rtcDisableGeometry call),
83 and enabled again (rtcEnableGeometry call). A geometry can be attached
84 to multiple scenes using the rtcAttachGeometry call (or rtcAttachGeome‐
85 tryByID call), and detached using the rtcDetachGeometry call. During
86 attachment, a geometry ID is assigned to the geometry (or assigned by
87 the user when using the rtcAttachGeometryByID call), which uniquely
88 identifies the geometry inside that scene. This identifier is returned
89 when primitives of the geometry are hit in later ray queries for the
90 scene.
91
92 Geometries can also be modified, including their vertex and index buf‐
93 fers. After modifying a buffer, rtcUpdateGeometryBuffer must be called
94 to notify that the buffer got modified.
95
96 The application can use the rtcSetGeometryUserData function to set a
97 user data pointer to its own geometry representation, and later read
98 out this pointer using the rtcGetGeometryUserData function.
99
100 After setting up the geometry or modifying it, rtcCommitGeometry must
101 be called to finish the geometry setup. After committing the geometry,
102 vertex data interpolation can be performed using the rtcInterpolate and
103 rtcInterpolateN functions.
104
105 A build quality can be specified for a geometry using the rtcSetGeome‐
106 tryBuildQuality function, to balance between acceleration structure
107 build performance and ray query performance. The build quality per ge‐
108 ometry will be used if a two-level acceleration structure is built in‐
109 ternally, which is the case if the RTC_BUILD_QUALITY_LOW is set as the
110 scene build quality. See Section [rtcSetSceneBuildQuality] for more
111 details.
112
113 EXIT STATUS
114 On failure NULL is returned and an error code is set that can be
115 queried using rtcGetDeviceError.
116
117 SEE ALSO
118 [rtcEnableGeometry], [rtcDisableGeometry], [rtcAttachGeometry], [rtcAt‐
119 tachGeometryByID], [rtcUpdateGeometryBuffer], [rtcSetGeometryUserData],
120 [rtcGetGeometryUserData], [rtcCommitGeometry], [rtcInterpolate],
121 [rtcInterpolateN], [rtcSetGeometryBuildQuality], [rtcSetSceneBuildQual‐
122 ity], [RTC_GEOMETRY_TYPE_TRIANGLE], [RTC_GEOMETRY_TYPE_QUAD], [RTC_GE‐
123 OMETRY_TYPE_SUBDIVISION], [RTC_GEOMETRY_TYPE_CURVE], [RTC_GEOME‐
124 TRY_TYPE_GRID], [RTC_GEOMETRY_TYPE_POINT], [RTC_GEOMETRY_TYPE_USER],
125 [RTC_GEOMETRY_TYPE_INSTANCE], [RTC_GEOMETRY_TYPE_INSTANCE_ARRAY]
126
127
128
129 rtcNewGeometry(3)