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
Under review

How to adjust line thickness

Michael Powell 5 years ago in Question • updated 5 years ago 5
...that or potentially some pipes would be better from the calculated points.

The calculations are going well enough, though I'm not precisely sure what the geometric orientations are, given center, converting degrees to radians, and so on. Experimenting for quadrants, once I make the appropriate flips on X/Y, cos/sin, the arch is starting to look like an arch with an increasing number of calculated segments.

WPF
0
Under review

Clickability between oxyplot and helix

pettertho 4 years ago in Question • updated by anonymous 2 years ago 9
Hi all,

Me and a classmate are doing a school assignment where we're asked to develop av visualizing program for tomography data. For parts of this project we are using Helix and Oxyplot. Helix to model the pipes in question with Pipe3D, and Oxyplot to plot an intensity chart for the data set.
The data set is several 2D matrices, one for each measurement. This is processed into a bitmap which is displayed onto the 3D model.

We are using MVVM as our design pattern.

We want to introduce clickability and interactivity between these two parts. When a point or a field is marked with the pointer in the oxyplot, the same area should also be marked on the Helix model, or vice versa. The question is which is the best way to do this, and how does one do it? (bear in mind we are not experienced programmers)

Please feel free to ask any questions!
0

Programmatic model transform not working

Michael Powell 5 years ago in Question • updated 5 years ago 1
I know that Xaml transforms are working, quite well as a matter of fact. I can ScaleTransform3D about axes to achieve simple mirroring, and it works very well. Such as this, mirrors left/right about the Y plane.
<h:RectangleVisual3D>
    <h:RectangleVisual3D.Transform>
        <ScaleTransform3D ScaleY="-1" />
    </h:RectangleVisual3D.Transform>
</h:RectangleVisual3D>
However, I am trying something similar via code behind, and it doesn't seem to be working quite as well; okay, not at all:
return new RectangleVisual3D
{
    Origin = new Point3D {X = 10d},
    LengthDirection = new Vector3D {X = 1d},
    Normal = new Vector3D {Z = 1d},
    Transform = new Transform3DGroup
    {
        Children = {new ScaleTransform3D(new Vector3D {X = -1d}),}
    }
};
My first guess is that perhaps there is some Xaml / Binding magic that is going on behind the scenes. First and a half guess, possibly something about initializing the Transform.Children is causing some problems.

I have also tried initializing RectangleVisual3D.Transform to a new ScaleTransform3D, at first; but then thought that perhaps it needed to be a Transform3DGroup instead, as per some of the example code I've seen listed.

Any other insights would be welcome, however.

Thank you...
WPF Media3D
0

UIElement Visual3DModel behaves differently than MeshGeometryVisual3D

Domvs Phi 4 years ago in Question • updated 4 years ago 1
Hello. I am testing HelixToolKit and I am trying to achieve a simple task:
Create a revolve object and display it on the 3D view port. Since I need the object to be clickable, I am adding it using the UIElement example (changed it to have the rotation instead of the sphere). This is partially achieved, this is, the object displays and I can click on it (and have a desired event), but the object does not render well as the MeshGeometryVisual3D.

See image. Blue glass was added with UIElement, while the red one with MeshGeometryVisual3D. The red one is ok - it is what I want to obtain, while the blue presents parts transparent. If I rotate the camera those parts turn solid, but others transparent. I do not believe that is a question of light as I tested several. The blue glass is half the size of the red one on propose.
In resume red glass is perfect, blue glass is defected.



Relevant WPF code:

 <h:HelixViewport3D x:Name="view1">
<h:SunLight/>
<h:GridLinesVisual3D Center="6 0 -0.5" Fill="Gray" Visible="True"/>
<local:Demo2Element3D></local:Demo2Element3D>
<h:MeshGeometryVisual3D Transform="{h:Translate -5,0,0}" MeshGeometry="{Binding GlassGeometry}" Fill="Red" Visible="True"/>
</h:HelixViewport3D>

Demo2Element3D construction (Blue glass):

 public class Demo2Element3D : UIElement3D {
public Demo2Element3D()
{
var gm = new GeometryModel3D();
var mb = new MeshBuilder();

var profile = new[] { new Point(0, 0), new Point(0, 0.4), new Point(0.06, 0.36), new Point(0.1, 0.1), new Point(0.34, 0.1), new Point(0.4, 0.14), new Point(0.5, 0.5), new Point(0.7, 0.56), new Point(1, 0.46) };
mb.AddRevolvedGeometry(profile, null, new Point3D(0, 0, 0), new Vector3D(0, 0, 1), 200);
gm.Geometry = mb.ToMesh();
gm.Material = Materials.Blue;
Visual3DModel = gm;
}

Red glass:

 public MeshGeometry3D GlassGeometry {
get
{
var builder = new MeshBuilder(true, true);
var profile = new[] { new Point(0 * 2, 0.4 * 2), new Point(0.06 * 2, 0.36 * 2), new Point(0.1 * 2, 0.1 * 2), new Point(0.34 * 2, 0.1 * 2), new Point(0.4 * 2, 0.14 * 2), new Point(0.5 * 2, 0.5 * 2), new Point(0.7 * 2, 0.56 * 2), new Point(1 * 2, 0.46 * 2) };
builder.AddRevolvedGeometry(profile, null, new Point3D(0, 0, 0), new Vector3D(0, 0, 1), 100);
return builder.ToMesh(true);
}
}

Any information is helpful as I am very new to Helix and even to WPF.
Thank you
0

Cutting a mesh with a plane of limited size?

Mehran Maghoumi 4 years ago in Question 0
I know that MeshGeometryHelper has the Cut method that can cut a mesh against a plane.
Obviously, that function uses the traditional math definition of a plane (a plane which has an infinite size).
Is there an easy way to adapt that method to perform a cut using a plane of limited size? In other words, let's say we have the point and the normal of the plane as well as its width and height. How could we cut only a part of the mesh that intersects with this "limited" plane?
Is there a straightforward way of doing this?
WPF
0
Under review

How to render an arch

Michael Powell 5 years ago in Question • updated 5 years ago 2
How would I render an arch, or arc, or semi-circle? Is there a CircleVisual3D element? Possibly a SphereVisual3D with a rectangular cross section? Or a fancy grouping of PipeVisual3D calculated along the geometry of an arc. Of course if I could just render the arc, that would be that.

My math/geometry is a bit rusty, but I can puzzle it out.

Thank you...
WPF
0

Same 3D-Model act like different one?

Ardahan 4 years ago in Question • updated 4 years ago 1

I load STL files to helixviewport3d and store them in dictionary as key and file name as value.

But then I load same STL file and check if it is already in dictionary. But then It is not found and adding same model into viewport. where do i go wrong?


WPF Media3D
0

Camera view of rectangles

Nit29 4 years ago in Question 0
Hi

I am new to 3d manipulation esp with helix toolkit.
Am trying to have a camera fixed to a side of rectangle. When the rectangle is rotated or moved, the camera should relatively change it's view. Is there any property that ties the camera to an object or a specific vector of an object? Also, there will be 2 rectangles used as planes intersecting making an 'X' shape from the top view. So there has to be 2 views of one side of each plane and a top view.

I am looking forward to understand a way to make this work.Thanks!
0

Automatically move manipulator

Arjan 4 years ago in Question 0
I have created a small example with a "robot" containing rotating axes.
With the three manipulators I can move the axis of the robot.
But I'm looking for a way to move the manipulators when the robot moves.
So when axis 1 of the robot moves you see all the 'stacked' objects moving but not the manipulators.
How can I achieve this?

Here is my source code:
SphereVisual3D sphereAxis1 = new SphereVisual3D();
sphereAxis1.Fill = new SolidColorBrush(Colors.Blue);
sphereAxis1.Center = new System.Windows.Media.Media3D.Point3D(0, 0, 0);
sphereAxis1.Radius = 1.0;
hvpMain.Children.Add(sphereAxis1);


RotateManipulator manipulatorAxis1 = new RotateManipulator();
manipulatorAxis1.Color = Colors.Blue;
manipulatorAxis1.Bind(sphereAxis1);
manipulatorAxis1.Axis = new System.Windows.Media.Media3D.Vector3D(0, 0, 1);
manipulatorAxis1.Diameter = 3.5;
manipulatorAxis1.InnerDiameter = 2.5;
hvpMain.Children.Add(manipulatorAxis1);


PipeVisual3D pipe1 = new PipeVisual3D();
pipe1.Fill = new SolidColorBrush(Colors.Orange);
pipe1.Diameter = 5.0;
pipe1.Point1 = new System.Windows.Media.Media3D.Point3D(0, 0, -1);
pipe1.Point2 = new System.Windows.Media.Media3D.Point3D(0, 0, 0);
sphereAxis1.Children.Add(pipe1);


PipeVisual3D pipe2 = new PipeVisual3D();
pipe2.Fill = new SolidColorBrush(Colors.Orange);
pipe2.Diameter = 2.0;
pipe2.Point1 = new System.Windows.Media.Media3D.Point3D(0, 0, 0);
pipe2.Point2 = new System.Windows.Media.Media3D.Point3D(0, 0, 2);
pipe1.Children.Add(pipe2);


SphereVisual3D sphereAxis2 = new SphereVisual3D();
sphereAxis2.Fill = new SolidColorBrush(Colors.Blue);
sphereAxis2.Center = new System.Windows.Media.Media3D.Point3D(0, 0, 2);
sphereAxis2.Radius = 1.0;
pipe2.Children.Add(sphereAxis2);


RotateManipulator manipulatorAxis2 = new RotateManipulator();
manipulatorAxis2.Pivot = new System.Windows.Media.Media3D.Point3D(0, 0, 2);
manipulatorAxis2.Axis = new System.Windows.Media.Media3D.Vector3D(0, 1, 0);
manipulatorAxis2.Color = Colors.Green;
manipulatorAxis2.Bind(sphereAxis2);
manipulatorAxis2.Position = new System.Windows.Media.Media3D.Point3D(0, 0, 2);
manipulatorAxis2.Diameter = 3.5;
manipulatorAxis2.InnerDiameter = 2.5;
hvpMain.Children.Add(manipulatorAxis2);


PipeVisual3D pipe3 = new PipeVisual3D();
pipe3.Fill = new SolidColorBrush(Colors.Orange);
pipe3.Diameter = 2.0;
pipe3.Point1 = new System.Windows.Media.Media3D.Point3D(0, 0, 2);
pipe3.Point2 = new System.Windows.Media.Media3D.Point3D(0, 0, 7);
sphereAxis2.Children.Add(pipe3);


SphereVisual3D sphereAxis3 = new SphereVisual3D();
sphereAxis3.Fill = new SolidColorBrush(Colors.Blue);
sphereAxis3.Center = new System.Windows.Media.Media3D.Point3D(0, 0, 7);
sphereAxis3.Radius = 1.0;
pipe3.Children.Add(sphereAxis3);


RotateManipulator manipulatorAxis3 = new RotateManipulator();
manipulatorAxis3.Pivot = new System.Windows.Media.Media3D.Point3D(0, 0, 7);
manipulatorAxis3.Axis = new System.Windows.Media.Media3D.Vector3D(0, 1, 0);
manipulatorAxis3.Color = Colors.Green;
manipulatorAxis3.Bind(sphereAxis3);
manipulatorAxis3.Position = new System.Windows.Media.Media3D.Point3D(0, 0, 7);
manipulatorAxis3.Diameter = 3.5;
manipulatorAxis3.InnerDiameter = 2.5;
hvpMain.Children.Add(manipulatorAxis3);


PipeVisual3D pipe4 = new PipeVisual3D();
pipe4.Fill = new SolidColorBrush(Colors.Orange);
pipe4.Diameter = 2.0;
pipe4.Point1 = new System.Windows.Media.Media3D.Point3D(0, 0, 7);
pipe4.Point2 = new System.Windows.Media.Media3D.Point3D(7, 0, 7);
sphereAxis3.Children.Add(pipe4);

Kind regards,

Arjan
0

DataTemplate3D for custom ModelVisual3D Xml/View

Michael Powell 5 years ago in Question • updated 5 years ago 4
I've got a custom ModelVisual3D, literally I extended into a Xml/View to build a model. I will likely have several of these animals, but each of them are a ModelVisual3D.

I am studying the WPF DataTemplate example, and it is interesting, data template acts as a kind of bridge into the 3D model?

I'm not sure what CreateItem is all about, except possibly a convention integrating with the sister ItemsVisual3D?

I wouldn't have such a thing in my model. In fact, I'm not sure I would potentially have one data template per model in the view, the content of which is the view instance?

It's making some sense grasping the connecting tissue.

Thank you...
WPF Media3D