Trabajando con cilindro
Personalizar parte superior offset
Aspose.3D for .NET permite personalizar Offset Top of a cylinder. Para usar esta funcionalidad, puede usar la propiedad Offset
de la clase Cylinder
. El siguiente fragmento de código muestra cómo personalizar Offset Top:
// For complete examples and data files, please go to https://github.com/aspose-3d/Aspose.3D-for-.NET | |
// Create a scene | |
Scene scene = new Scene(); | |
// Initialize cylinder | |
var cylinder1 = new Cylinder(2, 2, 10, 20, 1, false); | |
// Set OffsetTop | |
cylinder1.OffsetTop = new Vector3(5, 3, 0); | |
// Create ChildNode | |
scene.RootNode.CreateChildNode(cylinder1).Transform.Translation = new Vector3(10, 0, 0); | |
// Intialze second cylinder without customized OffsetTop | |
var cylinder2 = new Cylinder(2, 2, 10, 20, 1, false); | |
// Create ChildNode | |
scene.RootNode.CreateChildNode(cylinder2); | |
// Save | |
scene.Save("CustomizedOffsetTopCylinder.obj"); |
El izquierdo tiene OffsetTop configurado en (5, 3, 0), es fácil ver que la tapa superior se ha movido y todo el torso también se ve afectado.
Personalizar ShearBottom
Aspose.3D for .NET permite personalizar el fondo de corte de un cilindro. Para usar esta funcionalidad, puede usar la propiedad ShearBottom
de la clase Cylinder
. El siguiente fragmento de código muestra cómo personalizar Shear Bottom:
// For complete examples and data files, please go to https://github.com/aspose-3d/Aspose.3D-for-.NET | |
// Create a scene | |
Scene scene = new Scene(); | |
// Create cylinder 1 | |
var cylinder1 = new Cylinder(2, 2, 10, 20, 1, false); | |
// Customized shear bottom for cylinder 1 | |
cylinder1.ShearBottom = new Vector2(0, 0.83);// shear 47.5deg in xy plane(z-axis) | |
// Add cylinder 1 to the scene | |
scene.RootNode.CreateChildNode(cylinder1).Transform.Translation = new Vector3(10, 0, 0); | |
// Create cylinder 2 | |
var cylinder2 = new Cylinder(2, 2, 10, 20, 1, false); | |
// Add cylinder to without a ShearBottom to the scene | |
scene.RootNode.CreateChildNode(cylinder2); | |
// Save scene | |
scene.Save("CustomizedShearBottomCylinder.obj"); | |
El cilindro izquierdo tiene ShearBottom
a (0, 0,83) mientras que el derecho es un cilindro ordinal.
Crear ventilador-cilindro
Aspose.3D for .NET permite crear un cilindro de ventilador. Para utilizar esta funcionalidad, puede establecer la propiedad GenerateFanCylinder
de la clase Cylinder
en true
. El siguiente fragmento de código muestra cómo utilizar esta funcionalidad:
// For complete examples and data files, please go to https://github.com/aspose-3d/Aspose.3D-for-.NET | |
// Create a scene | |
Scene scene = new Scene(); | |
// Create cylinder 1 | |
var cylinder1 = new Cylinder(2, 2, 10, 20, 1, false); | |
// Customized shear bottom for cylinder 1 | |
cylinder1.ShearBottom = new Vector2(0, 0.83);// shear 47.5deg in xy plane(z-axis) | |
// Add cylinder 1 to the scene | |
scene.RootNode.CreateChildNode(cylinder1).Transform.Translation = new Vector3(10, 0, 0); | |
// Create cylinder 2 | |
var cylinder2 = new Cylinder(2, 2, 10, 20, 1, false); | |
// Add cylinder to without a ShearBottom to the scene | |
scene.RootNode.CreateChildNode(cylinder2); | |
// Save scene | |
scene.Save("CustomizedShearBottomCylinder.obj"); | |
El cilindro izquierdo tiene GenerateFanCylinder = false
y el derecho tiene GenerateFanCylinder = true
.