For bugs and new features, use the issue tracker located at GitHub.
Also try the chat room!
Wrong number of normal vectors.
everytimer wrote at 2014-03-12 08:38:
public GeometryModel3D Generate3D()
{
GeometryModel3D My3DModel = new GeometryModel3D(); //Materials ommited
List<Point3D> puntos = new List<Point3D>();
List<int> indices = new List<int>();
if (Elementos[i] is CTRIA3)
{
Point3D p1 = Elementos[i].Grids[0].ToPoint();
Point3D p2 = Elementos[i].Grids[1].ToPoint();
Point3D p3 = Elementos[i].Grids[2].ToPoint();
puntos.Add(p1);
puntos.Add(p2);
puntos.Add(p3);
int n = puntos.Count;
indices.Add(n - 3);
indices.Add(n - 2);
indices.Add(n - 1);
}
if (Elementos[i] is CQUAD4)
{
Point3D p1 = Elementos[i].Grids[0].ToPoint();
Point3D p2 = Elementos[i].Grids[1].ToPoint();
Point3D p3 = Elementos[i].Grids[2].ToPoint();
Point3D p4 = Elementos[i].Grids[3].ToPoint();
puntos.Add(p1);
puntos.Add(p2);
puntos.Add(p3);
puntos.Add(p4);
int n = puntos.Count;
indices.Add(n - 4);
indices.Add(n - 3);
indices.Add(n - 2);
indices.Add(n - 4);
indices.Add(n - 2);
indices.Add(n - 1);
}
//More geometric stuff
Mesh3D mesh = new Mesh3D(puntos, indices);
MeshBuilder mb = new MeshBuilder(false, false); //I've tried the default constructor too
mb.AddCylinder(new Point3D(0, 0, 0), new Point3D(100, 100, 100), 5, 20);
mb.Append(mesh.ToMeshGeometry3D()); //I've tried switching the order
//My3DModel.Geometry = mesh.ToMeshGeometry3D();
My3DModel.Geometry = mb.ToMesh();
return My3DModel;
}
What I want is to use both, manually created figures and using MeshBuilder class (for tubes, cones etc). But if I use the append method to try than, even if I do not add any stuff with the MeshBuilder I get this exception:An unhandled exception of type 'System.InvalidOperationException' occurred in HelixToolkit.Wpf.dllAdditional information: Wrong number of normal vectors.
What can I do to fix this situation? I know that there is a method called add triangles but It would be a bit difficult to implement for me right now.
objo wrote at 2014-03-12 15:56:
mb.Append(puntos, indices)
Zoom/Rotate around the mouse down point
3D Boolean Operations?
3dguy wrote at 2013-04-18 02:10:
objo wrote at 2013-04-18 09:37:
MeshGeometry3D
by planes. See the
MeshGeometryHelper.Cut
method. I am not planning to add more advanced 3D boolean operations here.Ruler (like photoshop ruler)
behnam263 wrote at 2014-05-31 08:53:
Could you tell me where i should start to get this approach?
Is there any built-in element in helix for this?
behnam263 wrote at 2014-08-02 20:19:
i mean by ruler is like this in 3d space with zoom and move (not rotate) , finding measures for an image or a plane.
subtracting one shape from another
Say I have 2 spheres(SphereVisual3D) and place them so that they overlap. Can I somehow subtract one from the other such that one sphere will have a dimple on it? Or subtracting a cylinder from a box to create a hole?
For a hole, maybe a circular cutting plane and triangulate the hole wall?
I know I can do this in Blender and the like and export the model, but what I'm basically trying to achieve is to have a single model and parameterize a few dimensions.
Any help or nudges would be greatly appreciated.
ScatterViews, Touch Events and Manipulators
Darkounet789 wrote at 2014-02-24 16:15:
I added a 3d viewport inside a scatterview item. So I had to manually add a manipulator to the cameracontroller in order to catch the manipulation events on the viewport, otherwise the scatterview catch it. I did it this way :
private void HV3DTouchDown(object sender, TouchEventArgs e)
{
CameraController cameraController = Viewport3D.CameraController;
try
{
Manipulation.AddManipulator(Viewport3D, e.TouchDevice.AsManipulator());
}
catch
{
Console.WriteLine("Error occured in Sketch3D.HV3DTouchDown");
}
e.Handled = true;
CaptureTouch(e.TouchDevice);
}
private void HV3DTouchLeave(object sender, TouchEventArgs e)
{
CameraController cameraController = Viewport3D.CameraController;
try
{
Manipulation.RemoveManipulator(cameraController, e.TouchDevice.AsManipulator());
}
catch
{
Console.WriteLine("Error occured in Sketch3D.HV3DTouchLeave");
}
e.Handled = true;
CaptureTouch(e.TouchDevice);
}
But now, I would like to catch the manipulation on a manipulator (or any other 3D object in my scene) and I can't figure out how to achieve it, because of the AddManipulator method which only takes a UIElement and not a UIElement3D...
Is there any workaround about this ?
Thanks in advance ! Regards.
(Sorry for my bad english...)
Create a tube of specific wall thickness
bradphelan wrote at 2013-07-10 09:56:
I've used MeshBuilder.AddTube to create a tube with open ends. If I wanted to create a tube with a specific wall thickness is there a method somewhere to create a shell from a such a surface?
I guess I'm looking for something like this
http://help.solidworks.com/2012/English/solidworks/sldworks/hidd_dve_feat_shell.htm
objo wrote at 2013-07-12 23:08:
But it would desirable to improve the current MeshBuilder method to support inner diameters and end caps! Sorry, I can't help you with this at the moment.
Turntable lockup after Animation
cobra18t wrote at 2011-12-07 22:03:
I have a few hotkeys that animate the camera in a HelixViewport3D to predefined positions and loodirections. After animating to those positions, the turntable control locks up so that only tilting left/right is available (changing updirection). Looking up/down or left/right is locked up. After clicking the view cube, the look control is reset and I can look around again.
Is there something that I can do in the code to make the turntable control available after an animation without clicking the view cube?
Thanks,
-Thomas
objo wrote at 2011-12-07 22:13:
What is the FillBehaviour of your animation? If it is HoldEnd you can try to change it to Stop.
I am also setting the end value before starting the camera animations, but not sure if this is the correct way to do it...
cobra18t wrote at 2011-12-07 22:43:
Thanks, that did it. I am not a fan of setting the end value before animating, but it works. I need to double check that it is not displaying a single frame at the end position before animating from the start to end. That could really mess up my system.
Thanks again!
Help with Scale Manipulator!!!
Raathigesh wrote at 2013-01-22 16:41:
Hi,
First of all thank you for the excellent toolkit.
I saw the example where translate manipulator used as a scale manipulator.
Example in xaml :
<ht:SphereVisual3D x:Name="sphere1" Center="-4,0,0" Fill="Orange"/> <ht:TranslateManipulator Color="Black" Position="-4,0,0" Offset="0,0,1" Length="1" Value="{Binding Radius, ElementName=sphere1}" Direction="0,0,1"/>
Can some one please guide to do the exact same thing in code behind.
EllipsoidVisual3D sphere = (EllipsoidVisual3D)model.Visual3D; TranslateManipulator x = new TranslateManipulator(); x.Direction = new Vector3D(0, 0, 1); x.Length = 10; x.Color = Colors.Black; x.Bind(sphere); //Guide me to use this as a scale manipulator instead of Translate Manipulator Thanks :)
Source I guess I was wrong.
DongMini wrote at 2013-02-05 01:13:
Line 203
if ((newUpDirection - modUpDir).Length > 1e-8)
{
d = 0.2;
}
a if ((newUpDirection - modUpDir).Length < 1e-8)
I guess you're right.objo wrote at 2013-02-07 20:06:
The other block looks suspicious, I agree. It is possible this change of up direction is not necessary - but I don't remember what I tried to achieve there. Should have added some more comments...
Do you find the "turnball" :-) mode useful? It was implemented as an experimental mixture of the turntable and trackball rotation modes...
Customer support service by UserEcho