AB4D Forum
Create "Elliptical Cylinder" - Printable Version

+- AB4D Forum (https://forum.ab4d.com)
+-- Forum: Products Forums (https://forum.ab4d.com/forumdisplay.php?fid=4)
+--- Forum: Ab3d.PowerToys (https://forum.ab4d.com/forumdisplay.php?fid=9)
+--- Thread: Create "Elliptical Cylinder" (/showthread.php?tid=4193)



Create "Elliptical Cylinder" - troy@gettageek.com - 04-30-2020

Hey Forum,

Been evaluating the PowerTools, great stuff.  One thing I haven't been able to figure out is how generate an "Elliptical Cylinder".  Basically create Ab3d.Visuals.CylinderVisual3D or Ab3d.Models.Model3DFactory.CreateCircle, but rather than provide a radius, provide Minor/Major axis?

Cheers!

Troy


RE: Create "Elliptical Cylinder" - troy@gettageek.com - 05-01-2020

Hey Forum,


Did some digging and have discovered the Ab3d.Utilities.Triangulator and Mesh3DFactory.CreateExtrudedMeshGeometry should get me what I need.

Really enjoying this library, great tools, Cheers!

Troy


RE: Create "Elliptical Cylinder" - abenedik - 05-04-2020

Great, Ab3d.Utilities.Triangulator and Mesh3DFactory.CreateExtrudedMeshGeometry can be also used for that task.

You can also use ScaleTransform3D to scale a cylinder along an axis. For example:

Code:
var cylinderVisual3D = new CylinderVisual3D()
{
   BottomCenterPosition = new Point3D(0, 0, 0),
   Height               = 50,
   Radius               = 30,
   Material             = new DiffuseMaterial(Brushes.Silver),
   Transform            = new ScaleTransform3D(scaleX: 2.0, scaleY: 1.0, scaleZ: 1.0)
};

Or in xaml:

Code:
<visuals:CylinderVisual3D BottomCenterPosition="0 0 0"
                         Height="50"
                         Radius="30"
                         Material="Silver">
   <visuals:CylinderVisual3D.Transform>
       <ScaleTransform3D ScaleX="2" />
   </visuals:CylinderVisual3D.Transform>
</visuals:CylinderVisual3D>