Arbeta med profiler
Arbeta med profiler
Profiler i Aspose.3D för .NET definierar 2D tvärsnittsformer som används som indata till extruderings- och solidrevolutionsoperationer. LinearExtrusion sveper en profil längs en bana och RevolvedAreaSolid roterar den kring en axel.
Parametriserade profiler
ParameterizedProfile tillhandahåller standard geometriska former — rektangel, cirkel, ellips, trapets och andra — som definieras av numeriska parametrar snarare än explicita polygonhörn.
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);Andra former i ParameterizedProfile:
| Klass | Parametrar |
|---|---|
RectangleShape | XDim, YDim, RoundingRadius |
CircleShape | Radius |
LShape | Width, Depth, Thickness, FilletRadius |
TShape | Depth, FlangeWidth, WebThickness, FlangeThickness |
Parametriserade L-formade profiler
LShape är en parametriserad profil som producerar en L-sektion strukturell balk från dimensionella egenskaper:
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);Speglade profiler
MirroredProfile skapar en symmetrisk tvärsnittsprofil genom att spegla en basprofil. Skicka in någon Profile-instans till konstruktorn; biblioteket genererar den speglade formen automatiskt.
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);Centrumlinjeprofiler
CenterLineProfile omsluter en Curve och en väggtjocklek för att producera ett ihåligt tvärsnitt (t.ex. en rörvägg). Skicka in centrumlinjekurvan och tjockleken till konstruktorn.
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 | Beskrivning |
|---|---|
new RectangleShape() | Rektangulär parametriserad profil (XDim, YDim, RoundingRadius) |
new CircleShape() | Cirkulär parametriserad profil (Radius) |
new LShape() | L-formad strukturell balkprofil |
new TShape() | T-formad strukturell balkprofil |
new MirroredProfile(base) | Symmetrisk profil speglad från en basprofil |
new CenterLineProfile(curve, thickness) | Ihålig profil med given väggtjocklek |
new LinearExtrusion(profile, height) | Svep en profil längs Z-axeln |
extrusion.Slices | Antal subdivisionssegment längs svepet |
new RevolvedAreaSolid() | Rotera en profil runt en axel; ställ in Shape och AngleEnd egenskaper |
Se även
- Aspose.3D for .NET — Enterprise Documentation
- Arbeta med scenentiteter — fäst extruderade solider på scen-noder