قم بإنشاء منحنى شريط 3d ناعم من سلسلة من النقاط باستخدام [link:https://en.wikipedia.org/wiki/Centripetal_Catmull-Rom_spline Catmull-Rom] خوارزمية.
// إنشاء حلقة مغلقة متموجة
const curve = new THREE.CatmullRomCurve3( [
new THREE.Vector3( -10, 0, 10 ),
new THREE.Vector3( -5, 5, 5 ),
new THREE.Vector3( 0, 0, 0 ),
new THREE.Vector3( 5, -5, 5 ),
new THREE.Vector3( 10, 0, 10 )
] );
const points = curve.getPoints( 50 );
const geometry = new THREE.BufferGeometry().setFromPoints( points );
const material = new THREE.LineBasicMaterial( { color: 0xff0000 } );
// إنشاء الكائن النهائي لإضافته إلى المشهد
const curveObject = new THREE.Line( geometry, material );
[example:webgl_geometry_extrude_splines WebGL / geometry / extrude / splines]
points – مصفوفة من نقاط [page:Vector3]
closed – ما إذا كان المنحنى مغلقًا. الافتراضي هو `false`.
curveType – نوع المنحنى. الافتراضي هو `centripetal`.
tension – توتر المنحنى. الافتراضي هو `0.5`.
راجع فئة [page:Curve] الأساسية للحصول على الخصائص المشتركة.
مصفوفة من نقاط [page:Vector3] التي تحدد المنحنى. يحتاج على الأقل إلى دخولين.
سيعود المنحنى إلى نفسه عندما يكون هذا صحيحًا.
القيم الممكنة هي `centripetal` و `chordal` و `catmullrom`.
عندما يكون [page:.curveType] هو `catmullrom` ، يعرف توتر catmullrom.
راجع فئة [page:Curve] الأساسية للحصول على طرق مشتركة.
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]