Daya giridhar
Daya giridhar

Reputation: 25

how to minimize STL file after loading to the viewport 3D of HELIX in a WPF application

Hello I made an application through which user can import an STL file, I have made it as WPF application and trying to open the file using Helix 3D tool kit but the problem is when I'm trying to open my STL file the image gets enlarged and I'm unable to minimize its size /keep it fit in the center. enter code here Please find the attached code I have written for opening STL file. MainWindow.XAML//imported helix 3d toolkit for opening STL files

helix:HelixViewport3D x:Name="viewPort3d" ZoomExtentsWhenLoaded="True" CoordinateSystemHeight="100" Margin="0,50,0,0"

MainWindow.XAML,cs File// on button click I'm importing the STL file.

            string filename = dlg.FileName;
            FileNameTextBox.Text = filename;                
            ModelVisual3D device3D = new ModelVisual3D();             
            device3D.Content = Display3d(filename );              
            viewPort3d.Children.Add(device3D);  //here iam loading the stl file to the   helix:HelixViewport3D  

please find the below images for better understanding

my output enter image description here

Desired Output enter image description here

can you please help me how to minimize the STL file size after loading to the viewport3D.

Thanks in advance

Upvotes: 1

Views: 775

Answers (1)

Alex
Alex

Reputation: 81

Simply using viewPort3d.ZoomExtents(); should work.

Upvotes: 1

Related Questions