ทำงานกับโปรไฟล์
การทำงานกับโปรไฟล์
โปรไฟล์ใน Aspose.3D สำหรับ .NET กำหนดรูปทรงข้ามส่วน 2D ที่ใช้เป็นอินพุตสำหรับการดันออกและการหมุนของแข็ง LinearExtrusion ลากโปรไฟล์ตามเส้นทางและ RevolvedAreaSolid หมุนมันรอบแกน.
โปรไฟล์ที่กำหนดค่าพารามิเตอร์
ParameterizedProfile ให้รูปทรงเรขาคณิตมาตรฐาน — สี่เหลี่ยม, วงกลม, รูปรี, รูปสี่เหลี่ยมคางหมู, และอื่น ๆ — ซึ่งกำหนดโดยพารามิเตอร์เชิงตัวเลขแทนการกำหนดจุดยอดของหลายเหลี่ยมโดยตรง.
using Aspose.ThreeD;
using Aspose.ThreeD.Entities;
using Aspose.ThreeD.Profiles;
var scene = new Scene();
// Rectangle profile: 2 units wide, 1 unit tall
var rectProfile = new RectangleShape();
rectProfile.XDim = 2.0;
rectProfile.YDim = 1.0;
// Extrude the rectangle 5 units along Z
var extrusion = new LinearExtrusion(rectProfile, 5.0);
extrusion.Slices = 10;
scene.RootNode.CreateChildNode("beam", extrusion);
scene.Save("beam.gltf", FileFormat.GLTF2);รูปทรงอื่น ๆ ใน ParameterizedProfile:
| คลาส | พารามิเตอร์ |
|---|---|
RectangleShape | XDim, YDim, RoundingRadius |
CircleShape | Radius |
LShape | Width, Depth, Thickness, FilletRadius |
TShape | Depth, FlangeWidth, WebThickness, FlangeThickness |
โปรไฟล์รูปตัว L ที่กำหนดค่าพารามิเตอร์
LShape เป็นโปรไฟล์ที่กำหนดค่าพารามิเตอร์ซึ่งสร้างคานโครงสร้างรูปตัว L จากคุณสมบัติด้านมิติ:
using Aspose.ThreeD.Profiles;
// L-shaped cross-section structural beam
var lProfile = new LShape();
lProfile.Width = 0.1;
lProfile.Depth = 0.2;
lProfile.Thickness = 0.01;
var extrusion = new LinearExtrusion(lProfile, 4.0);
scene.RootNode.CreateChildNode("l_beam", extrusion);โปรไฟล์สะท้อน
MirroredProfile สร้างส่วนตัดสมมาตรโดยการสะท้อนโปรไฟล์ฐาน ส่งออบเจกต์ Profile ใด ๆ ไปยังคอนสตรัคเตอร์; ไลบรารีจะสร้างรูปทรงที่สะท้อนโดยอัตโนมัติ.
using Aspose.ThreeD.Profiles;
// Base profile to mirror
var baseProfile = new RectangleShape();
baseProfile.XDim = 0.5;
baseProfile.YDim = 1.0;
// Mirror the base profile to get a symmetric shape
var mirrored = new MirroredProfile(baseProfile);
var extrusion = new LinearExtrusion(mirrored, 3.0);
scene.RootNode.CreateChildNode("symmetric_beam", extrusion);โปรไฟล์ศูนย์กลาง
CenterLineProfile หุ้ม Curve พร้อมความหนาผนังเพื่อผลิตส่วนตัดเป็นช่องว่าง (เช่น ผนังท่อ). ส่งเส้นโค้งศูนย์กลางและความหนาไปยังคอนสตรัคเตอร์.
using Aspose.ThreeD.Profiles;
using Aspose.ThreeD.Entities;
var circle = new Circle { Radius = 0.5 };
var tube = new CenterLineProfile(circle, 0.05); // 5 cm wall
var extrusion = new LinearExtrusion(tube, 10.0);
scene.RootNode.CreateChildNode("pipe", extrusion);API Quick Reference
| Member | คำอธิบาย |
|---|---|
new RectangleShape() | โปรไฟล์สี่เหลี่ยมผืนผ้าแบบพารามิเตอร์ (XDim, YDim, RoundingRadius) |
new CircleShape() | โปรไฟล์วงกลมแบบพารามิเตอร์ (Radius) |
new LShape() | โปรไฟล์คานโครงสร้างรูปตัว L |
new TShape() | โปรไฟล์คานโครงสร้างรูปทรง T |
new MirroredProfile(base) | โปรไฟล์สมมาตรที่สะท้อนจากโปรไฟล์ฐาน |
new CenterLineProfile(curve, thickness) | โปรไฟล์กลวงที่มีความหนาผนังตามที่กำหนด |
new LinearExtrusion(profile, height) | สวิงโปรไฟล์ตามแกน Z |
extrusion.Slices | จำนวนส่วนย่อยของการสวิง |
new RevolvedAreaSolid() | หมุนโปรไฟล์รอบแกน; ตั้งค่า Shape และ AngleEnd |
ดูเพิ่มเติม
- Aspose.3D for .NET — Enterprise Documentation
- การทำงานกับเอนทิตี้ของฉาก — แนบของแข็งที่ดันออกไปยังโหนดของฉาก