This is the discussion forum for Helix Toolkit.
For bugs and new features, use the issue tracker located at GitHub.
Also try the chat room!
0

Building an ActiveX control from Helix

Anonymous 10 years ago 0
This discussion was imported from CodePlex

davepylatuk wrote at 2012-05-10 18:11:

Hello all,

This toolkit looks amazing, takes much of the grunt work out of building 3D wpf graphics. I am wondering how large a task it would be to build an ActiveX control using this toolkit? I have a requirement to build a control that can draw:

- 3D Cylinders and cones (with different textures)

- Rectangular 'pipes' (tubing)

- Text to annotate objects in the 3D space

- Lines and polylines

- Apply different colors and lighting to the scene

- Rotate, zoom, pan, print and export the 3D view

I am very new to Visual Studio... Thanks.


objo wrote at 2012-05-10 21:36:

see http://stackoverflow.com/questions/4134833/how-to-use-winforms-wpf-as-activex-control

Sorry, I don't know more about using WPF in COM/ActiveX.

0

Helix Solution not working.

Anonymous 10 years ago 0
This discussion was imported from CodePlex

Rogad wrote at 2014-05-30 17:16:

Hi,

I hadn't updated my Helix for while, so I started fresh with TortoiseHg - I followed the instructions here :

https://helixtoolkit.codeplex.com/wikipage?title=Obtain%20and%20build%20the%20code&referringTitle=Documentation

But when I try to open HelixToolkit.Wpf.sln it throws this error :
Unsupported
This version of Visual Studio is unable to open the following projects. The project types may not be installed or this version of Visual Studio may not support them.
For more information on enabling these project types or otherwise migrating your assets, please see the details in the "Migration Report" displayed after clicking OK
HelixToolkit, "C:\Users\Roger\Documents\Visual Studio 2013\Projects\HELIX\Source\HelixToolkit\HelixToolkit.csproj"
In the following migration report I get this :
HelixToolkit\HelixToolkit.csproj: The application which this project type is based on was not found. Please try this link for further information: http://go.microsoft.com/fwlink/?LinkID=299083&projecttype=786C830F-07A1-408B-BD7F-6EE04809D6DB
The rest of the files appear to be migrated okay as they all have ticks.

Now I cannot work on my project sadly. Could someone please help ?

Many thanks,

Rog.

Rogad wrote at 2014-05-30 17:19:

P.S. I am using Visual Studio 2013 Express.

Rogad wrote at 2014-06-05 19:22:

Any thoughts ?

objo wrote at 2014-06-25 10:00:

The HelixToolkit.csproj project is a portable class library.
I think you have two options:
  1. You can change this to a class library to compile with VS Express.
  2. You can also remove the project and references in the solution, the project is not yet in use. This option will not work when code is added to that project
0

TubeVisual3D and Diameters

Anonymous 10 years ago 0
This discussion was imported from CodePlex

Lekarsenten wrote at 2013-02-16 20:25:

Have nice time of a day.
At first, I want to say "thank you", Your project is something awesome.
I didn't dive deep into Your code yet, but i have a question. As I can see, TubeVisual3D is an element for making curve tubes with variable diameters throug path - so, what i'm doing wrong?:
TubeVisual3D t = new TubeVisual3D();
            t.Fill = System.Windows.Media.Brushes.Black;
            
            Point3DCollection p3dc = new Point3DCollection();
            List<double> diamlist = new List<double>();
            double dx = 15;
            double dy = 15;
            double dz = 15;
            double dd = 10;
            int n = 30;
            for (int i = 1; i < n; i++)
            {
                p3dc.Add(new Point3D(0 + Math.Pow((double)i / n, 3) * dx, 0 + ((double)i / n) * dy, 0 + ((double)i / n) * dz));
                diamlist.Add(3.5 + ((double)i / n) * dd);
            }
            t.Path = p3dc;
            t.Diameters = diamlist;            
            _HelixViewport3D.Children.Add(t);
and i'm got curve pipe with constant diameter of 1.

Best regards.

p.s. sorry for my bad english, it isn't my native language)

objo wrote at 2013-02-16 22:18:

try changing the order of setting Diameters and Path
t.Diameters = diamlist;
t.Path = p3dc;
If you set the diameters last, the mesh will be generated twice.
I will correct the bug.

lekarsenten wrote at 2013-02-17 07:15:

Wow! Great. TY.
0

Disposing of Helix Viewport and contents

Anonymous 10 years ago 0
This discussion was imported from CodePlex

Rogad wrote at 2014-03-01 21:17:

Is there a way to dispose of these ?

My problem is this....I have two windows. One does operations on files and the second window shows the model in the viewport.

Even when I close the second window with the viewport, the system still has a connection with the files previously used by the viewport.

So when I return to window one I get an error that my files are already being used (by window two).

I thought using Close() on window two would clear things, but it does not.
0

Drag & Drop ModelVisual3D

Anonymous 10 years ago 0
This discussion was imported from CodePlex

davidop wrote at 2013-05-31 08:50:

Hi!. Congratulations for this great library. I am using Helix + Petzold ModelVisual3D drag and drop within a 3D scene. I wonder if it would be possible with Helix similiar effect to which the application is made in Rhinoceros. How they get that dragging a ModelVisual3D with the mouse remains static back home in his position?

objo wrote at 2013-06-08 07:53:

You should create a copy of the visual while performing the manipulation. I think you can add the copy to your scene when the manipulators mouse down event is raised and remove it on mouse up.
I think this should be handled by the application, not by the Manipulator classes.
0

Using a diameter list halves diameter?

Anonymous 10 years ago 0
This discussion was imported from CodePlex

SeanV12 wrote at 2013-06-18 16:45:

Sorry to do two threads back to back, but I've run into another problem.
As the title said, using a diameter list for a TubeVisual3D instead of one set diameter seems to half the diameter at every point.

I've edited streamlines to see if the problem is here, and it doesn't seem so, setting the tube diameters to one, and the cone radius to .5 produced similar diameters, so I would guess the MeshBuilder tubes are fine, but this:
 private void DiamListTube_Click(object sender, RoutedEventArgs e)
        {
            TubeVisual3D diamListTube = new TubeVisual3D();

            Point3DCollection tubePath = new Point3DCollection();
            tubePath.Add(new Point3D(0,  0, 5));
            tubePath.Add(new Point3D(32, 0, 5));

            IList<double> diameterList = new List<double>();
            diameterList.Add(10.0);
            diameterList.Add(10.0);

            diamListTube.Diameters = diameterList;
            diamListTube.Path = tubePath;
            diamListTube.Fill = Brushes.Red;
            MainViewPort.Children.Add(diamListTube);
        }

        private void NoDiamList_Click(object sender, RoutedEventArgs e)
        {
            TubeVisual3D tube = new TubeVisual3D();    

            Point3DCollection tubePath = new Point3DCollection();
            tubePath.Add(new Point3D(0, 10, 5));
            tubePath.Add(new Point3D(32, 10, 5));

            tube.Diameter = 10.0;
            tube.Path = tubePath; 
            tube.Fill = Brushes.Blue;
            MainViewPort.Children.Add(tube);

        }
Produces this:


Am I doing something wrong, or is the Diameter list the issue?

objo wrote at 2013-06-18 22:11:

thanks, this is a bug in the library! I added issue https://helixtoolkit.codeplex.com/workitem/9988

objo wrote at 2013-06-19 21:32:

I have corrected the bug in the TubeVisual3D class.
I also changed the type of the Diameters property, so we can test by the following xaml:
<HelixToolkit:TubeVisual3D Path="0 0 5,32 0 5" Diameters="10,10" Fill="Red"/>
<HelixToolkit:TubeVisual3D Path="0 10 5,32 10 5" Diameter="10" Fill="Blue"/>
0

Extrude Polyline

Anonymous 10 years ago 0
This discussion was imported from CodePlex

CesarMayorine wrote at 2013-10-08 10:34:

how I can extrude a polyline?
Anyone have an example?

ErOt79 wrote at 2013-10-17 12:55:

Please, i need the same help. I tried AddExtrudedGeometry but didnt understand well the use of it. A simple sample of extruded polygon geometry could be very helpful. Thanks!!

rinaldin wrote at 2013-10-25 15:48:

See here I hope it helps.

CesarMayorine wrote at 2013-10-25 22:21:

thank you rinaldin, exactly what I need.
Please i need an example in C # or VB, with a curve would be great

rinaldin wrote at 2013-10-28 18:19:

        ' the Path is a Point3DCollection and the Section is a PointCollection
        Dim sect As New PointCollection
        ' rettangolare
        sect.Add(New Point(-1, -1))
        sect.Add(New Point(0, -1))
        sect.Add(New Point(1, 1))
        sect.Add(New Point(-1, 1))
        Dim asse As New Vector3D(1, 0, 0)

        Dim rend As New ExtrudedVisual3D
        rend.Section = sect
        rend.Path.Add(pt)
        rend.Path.Add(pt1)
        rend.SectionXAxis = asse
        rend.Fill = Brushes.Green
        rend.IsPathClosed = True
        rend.IsSectionClosed = True
        HelixViewport3D1.Children.Add(rend)

        container.Children.Add(rend)

CesarMayorine wrote at 2013-10-30 08:51:

Thanks you,
is great, I have a problem with rend.SectionXAxis = asse, you can help me?.

rinaldin wrote at 2013-10-30 14:22:

"asse" is a vector orthogonal to the extrusion axis. You have to orient it to the desired direction , but always othogonal to the vector connecting pt and pt1 (starting and ending points of the extrusion).

CesarMayorine wrote at 2013-10-30 16:51:

Is posibel added caps to the extrusion?

rinaldin wrote at 2013-10-30 19:41:

I didn't try yet, but I think so; add a Polygon using the sect points.
0

shadows for obects

Anonymous 10 years ago updated by Lucas Silva 10 years ago 1
This discussion was imported from CodePlex

ChevyCP wrote at 2012-01-05 20:45:

Hi,

   Is there an easy way to add a shadow for all objects within a helixviewport3d?  I added a dropshadow effect, which is what I'm going for, but that doesn't change when I rotate the objects inside relative to the light source.  (So that it would grow and shrink depending on where the objects were in the scene.)  I understand that this could be a costly function, but was looking for a solution.  If this doesn't exist, then I'd like to add it as a feature request.

Thanks!!  Great work!



ChevyCP wrote at 2012-01-05 21:47:

Thanks for the fast reply and useful info!!  This isn't critical, I was just looking for some eye candy for a program I'm writing.  It's for work and instead of using pop-ups it uses sides of a 3d cube using a helixviewport3d with 6 viewport2dvisual3d's.  I was just looking for an easy way to add some cool shadows for use during the animations when rotating from side to side.

Thanks!!

0

Missing wiki page: Create a 3D view

Anonymous 10 years ago 0
This discussion was imported from CodePlex

hasanabb wrote at 2013-12-29 10:41:

Hello,

The documentation on the following page seems to be missing:
http://helixtoolkit.codeplex.com/wikipage?title=Create a 3D view&referringTitle=Documentation

I found the link on this page:
http://helixtoolkit.codeplex.com/documentation

Can you look into fixing this page?

Thank you.

objo wrote at 2014-01-07 22:53:

Yes, we should put some effort into the documentation.
Currently, the best way to learn this library is to look at the code for the examples.
Start with Source\Examples\SimpleDemo
0

Model up direction on sphere surface

Anonymous 10 years ago 0
This discussion was imported from CodePlex

Cowhide wrote at 2014-01-16 22:04:

I want to position loaded models (.obj) on the surface of a sphere (like the Earth demo for example) but I want them to stay "up", point towards the normal direction. Problem is I can't seem to find a way to set the normal of a loaded model. From what I gather, the normal can be computed as:

Vector3D normal = (placementPosition - centerOfSphere).Normalize

So lets say I have a Point3D for the position of the object. I then translate transform the objects position to put it at this point which works. Next is to rotate it somehow to that it is pointing "up". This is the part I'm missing. Please be gentle, just learning 3D programming.

Thanks!

objo wrote at 2014-01-23 20:07:

You need to specify one more vector that defines the orientation of the model.
Then use the Vector3D.CrossProduct to find a vector that is perpendicular to the two others. Normalize the vectors and now you have an orthonormal basis.
Define a Matrix3D where m11-m33 are the components of the three vectors (defined in rows or columns, I never remember...) and finally create a MatrixTransform3D.

This would be a nice example to add to the example browser - e.g. a sphere with the earth texture and the eiffel tower model - they are already in there!