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

Wireframe

Anonymous 11 years ago updated by anonymous 8 years ago 2
This discussion was imported from CodePlex

behnam263 wrote at 2014-04-16 16:25:

Is there any thing to show object(ex:cube , arrow ,etc) in wire frame mode?

behnam263 wrote at 2014-04-18 21:13:

haha again i found my answer in another website:
this is what page is:
http://blog.csharphelper.com/2014/04/17/draw-a-3d-wireframe-model-for-a-meshgeometry3d-using-wpf-and-xaml.aspx?ref=rss
MeshExtensions.cs is needed in your code
0

HelixToolkit (incompatible), cant run/build samples

Diedre Carmo 10 years ago updated by Lucas Silva 10 years ago 1
When i open HelixToolkit.Wpf solution i get this problem in visual studio:


Image 16

Any solution that i try to open gives me this problem. I am using VS 2013
0

Intersection of an stl object and plane3d

Anonymous 11 years ago 0
This discussion was imported from CodePlex

abuseukk wrote at 2013-02-05 13:35:

Hi guys,

I am trying to find the intersection points of GeometryModel3D and a plane. The model is STL file and loaded by the helix methods. I thought that I have all the triangles and with the implemented intersection of line and Plane3D i will find the points easily but that's not true. I don't know why I find so many points on the plane but not only the intersection points - What I mean is that Plane3D.LineIntersection(...) every time return some points but not null. If someone have an idea it will be grateful :) Thanks
MeshGeometry3D modelGeometry = (MeshGeometry3D)hitgeo.Geometry;

for (int i = 0; i < modelGeometry.TriangleIndices.Count; i=i+3)
{
    int index1 = modelGeometry.TriangleIndices[i];
    int index2 = modelGeometry.TriangleIndices[i+1];
    int index3 = modelGeometry.TriangleIndices[i+2];

    Point3D point1 = modelGeometry.Positions[index1];
    Point3D point2 = modelGeometry.Positions[index2];
    Point3D point3 = modelGeometry.Positions[index3];


    Point3D? intersection1 = p3d.LineIntersection(point1, point2);
    Point3D? intersection2 = p3d.LineIntersection(point1, point3);
    Point3D? intersection3 = p3d.LineIntersection(point2, point3);


    if(intersection1 != null)
    {
        IntersectionPoints.Add(intersection1);
    }
    if(intersection2 != null)
    {
        IntersectionPoints.Add(intersection2);
    }
    if(intersection3 != null)
    {
        IntersectionPoints.Add(intersection3);
    }
}

abuseukk wrote at 2013-02-07 09:50:

I found it ... the interesction is not line and plane its ray and plane, I had to check if the point is on the line :)

objo wrote at 2013-02-07 19:59:

Great! (For general use you may also need to account for transforms applied to your model)

Also see the contouring example in Source\Examples\ExampleBrowser\Examples\Contour
0

Cylinder becomes Multilateral body in Helix 3D

Anonymous 11 years ago 0
This discussion was imported from CodePlex

musicxpg wrote at 2013-02-25 14:49:

Hi,

I am using Helix 3D Toolkit. It is an amazing tool. I exported 3ds file from Skecthup. Then, I imported it into my WPF application. However, I found that the cylinder in Sketchup looks naturally, more like a cycle. However, in the WPF application, It changes to multilateral body. How to solve this problem?

objo wrote at 2013-03-13 07:09:

Can you upload the 3ds file and some screenshots from Sketchup?
0

How to keep the coordinate system always at (0,0,0) point?

Anonymous 11 years ago 0
This discussion was imported from CodePlex

chinh_nguyen wrote at 2013-01-08 15:38:

Hi, first of all, thank you for the great work, now I can zoom, rotate with ease.

I have 1 question here: how to keep the coordinate system always at (0,0,0) point?. Because I am draw graph so I need to make it there.


chinh_nguyen wrote at 2013-01-10 09:16:

Hi all, I found my answer, I did not know about CoordinateSystemVisual3D, how silly of me.

0

MeshGeometryHelper Cut Method Help: Normals Flipping and Cannot Cut Twice

Nathan Smela 10 years ago updated 10 years ago 0

Good Day Everyone,


I'm having a hard time with cutting a model in my program. I import a STL file into a Model3DGroup, add that model to a MeshBuilder (true for include normals), and attempt to cut the model along the 0 z-axis (pInf and nInf) This is to ensure it has a flat base to 3D print on.


First issue:

The flat cut is inverted when added. If i add a larger model, it inverts all the normals and appear to be inside out.


Second issue:

I attempt to cut the model at 10 mm (pSup and nSup), but the attempt keeps failing. It will fail even if I comment out the 0 z-axis cut.


private void CutBottom()        {
            //load the stl file to edit
            string file = @"E:\Test\test.stl";
            var mi = new ModelImporter();
            Model3DGroup model = mi.Load(file, System.Windows.Threading.Dispatcher.CurrentDispatcher);


            //convert model to Geometry3D
            MeshBuilder meshModel = new MeshBuilder(true, false);


            foreach (var m in model.Children)
            {
                var mGeo = m as GeometryModel3D;
                var tri = (MeshGeometry3D)mGeo.Geometry;


                if (tri != null)
                {
                    meshModel.Append(tri);
                }
            }


            MeshGeometry3D mesh = meshModel.ToMesh();


            //create a copy of the mesh 
            var g = mesh as MeshGeometry3D;
            MeshGeometry3D gOrig = g.Clone();


            //Cut the Mesh and then apply the cutplane
            var pInf = new Point3D(0, 0, 0);
            var nInf = new Vector3D(0, 0, 1);
            Plane3D cpInf = new Plane3D(pInf, nInf);


            var pSup = new Point3D(0, 0, 2);
            var nSup = new Vector3D(0, 0, 3);
            Plane3D cpSup = new Plane3D(pSup, nSup);


            //cp, p & n are the cut plane (Plane3D) and the position (Point3D) and the normal (Vector3D) of the plane
            g = MeshGeometryHelper.Cut(g, pInf, nInf);        
            g = MeshPlaneCut(g, gOrig, cpInf);
            //g = MeshPlaneCut(g, gOrig, cpSup);


            DiffuseMaterial graySide = new DiffuseMaterial(new SolidColorBrush(Colors.Gray));
            var meshGeo = new GeometryModel3D(g, graySide);
            Model3DGroup finalModel = new Model3DGroup();
            finalModel.Children.Add(meshGeo);


            //remove gridlines
            


            bolusMesh.Content = finalModel;


            //export stl
            Viewport.Viewport.Children.Remove(grids);
            Viewport.Export(@"E:\Test\test_cut.stl");
            Viewport.Viewport.Children.Add(grids);
        }


        private static MeshGeometry3D MeshPlaneCut(MeshGeometry3D meshCut, MeshGeometry3D meshOrig, Plane3D plane)
        {
            //Store the positions on the cut plane
            var segments = MeshGeometryHelper.GetContourSegments(meshOrig, plane.Position, plane.Normal).ToList();


            //assumes largest contour is the outer contour!
            IList<Point3D> vertexPoints = MeshGeometryHelper.CombineSegments(segments, 1e-6).ToList().OrderByDescending(x => x.Count).First();


            //meshCut the polygon opening and add to existing cut mesh
            var builder = new MeshBuilder(false, false);
            builder.Append(meshCut.Positions, meshCut.TriangleIndices);
            builder.AddPolygon(vertexPoints);


            MeshGeometry3D mg3D = builder.ToMesh();


            return mg3D;
        }
0

Is there any option to have a material base axis in coloraxis demo?

Anonymous 11 years ago 0
This discussion was imported from CodePlex

behnam263 wrote at 2014-05-06 12:28:

Hi
I want to know if there is any option to have a material base axis in coloraxis demo?
0

VoxelDemo source (and some other example sources) missing?

Anonymous 11 years ago 0
This discussion was imported from CodePlex

rasc wrote at 2012-06-07 23:00:

Hi,

perhaps I am missing something, but it seems that in the current source code download the voxeldemo (and some others) are not available. I would very much appreciate to be able to have a glance at it.

thank you

Ralph


objo wrote at 2012-06-08 07:34:

It was moved into the "ExampleBrowser" application. Will add a note where to find it on the wiki page.


rasc wrote at 2012-06-08 11:24:

Found it...This is really a great project - thank you for sharing

Ralph

0

Creating Solid Cube ...

Anonymous 11 years ago 0
This discussion was imported from CodePlex

maruf_bd wrote at 2013-07-24 08:39:

I want to create a solid cube in helix toolkit in wpf . Assume that a solid cube around a pipe and I want to intersect it so that I can see half pipe and half solid cube . Please help me .

Thanks in advance
0

The "HelixViewwport3D "not have

Anonymous 11 years ago 0
This discussion was imported from CodePlex

xiaotu wrote at 2013-07-19 05:28:

hi, I am begin to learn the Helix toolkit ,when i open the helix toolkit sampleDemo , find the error message "namespace 'clr-namespace:HelixToolkit.Wpf;assembly=HelixToolkit.Wpf' without the HelixVeiwport3D" .how to soolve it.thanks

Mrme wrote at 2013-07-19 10:53:

Hi, if you go and see your references, you will find some of them are missing, fix that !