کار با پروفایلها
کار با پروفیلها
پروفیلها در Aspose.3D برای .NET شکلهای مقطع دو-بعدی را تعریف میکنند که به عنوان ورودی برای عملیات اکستروژن و چرخش جامد استفاده میشوند. 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 بهصورت Sweep کنید |
extrusion.Slices | تعداد بخشهای تقسیمبندی در طول Sweep |
new RevolvedAreaSolid() | پروفایل را حول یک محور بچرخانید؛ ویژگیهای Shape و AngleEnd را تنظیم کنید |
همچنین ببینید:
- Aspose.3D for .NET — Enterprise Documentation
- کار با موجودیتهای صحنه — اتصال جامدات برآمده به گرههای صحنه