Trabalhando com Perfis
Trabalhando com Perfis
Perfis em Aspose.3D para .NET definem formas de seção transversal 2D usadas como entradas para operações de extrusão e revolução sólida. LinearExtrusion varre um perfil ao longo de um caminho e RevolvedAreaSolid o revolve ao redor de um eixo.
Perfis Parametrizados
ParameterizedProfile fornece formas geométricas padrão — retângulo, círculo, elipse, trapézio e outras — definidas por parâmetros numéricos ao invés de vértices de polígono explícitos.
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);Outras formas em ParameterizedProfile:
| Classe | Parâmetros |
|---|---|
RectangleShape | XDim, YDim, RoundingRadius |
CircleShape | Radius |
LShape | Width, Depth, Thickness, FilletRadius |
TShape | Depth, FlangeWidth, WebThickness, FlangeThickness |
Perfis em L Parametrizados
LShape é um perfil parametrizado que produz uma viga estrutural em seção em L a partir de propriedades dimensionais:
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);Perfis Espelhados
MirroredProfile cria uma seção transversal simétrica ao espelhar um perfil base. Passe qualquer instância de Profile para o construtor; a biblioteca gera a forma espelhada automaticamente.
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);Perfis da Linha Central
CenterLineProfile envolve um Curve e uma espessura de parede para produzir uma seção transversal oca (por exemplo, uma parede de tubo). Passe a curva da linha central e a espessura para o construtor.
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 | Descrição |
|---|---|
new RectangleShape() | Perfil retangular parametrizado (XDim, YDim, RoundingRadius) |
new CircleShape() | Perfil circular parametrizado (Radius) |
new LShape() | Perfil de viga estrutural em forma de L |
new TShape() | Perfil de viga estrutural em forma de T |
new MirroredProfile(base) | Perfil simétrico espelhado a partir de um perfil base |
new CenterLineProfile(curve, thickness) | Perfil oco com espessura de parede especificada |
new LinearExtrusion(profile, height) | Varra um perfil ao longo do eixo Z |
extrusion.Slices | Número de segmentos de subdivisão ao longo da varredura |
new RevolvedAreaSolid() | Gire um perfil em torno de um eixo; defina as propriedades Shape e AngleEnd |
Ver também
- Aspose.3D for .NET — Enterprise Documentation
- Trabalhando com Entidades de Cena — anexar sólidos extrudados aos nós da cena