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

taking care of transforms with GetContourSegments and multiple models?

Anonymous 11 years ago 0
This discussion was imported from CodePlex

3dguy wrote at 2013-04-11 00:12:

I'm trying to us GetContourSegments as shown in the Contour example but it doesn't seem to apply post transform. I've examined the code and it appears Visual3DHelper.Traverse<GeometryModel3D>(model1, this.AddContours); should take care of transforms?

I put out the example below and it gives the contours for the original sphere and not the end resulting scaled sphere.

Also is there a way to compute contours of a model group or is the only way computing contours of each object then joining them together?

Thanks.

Code:
        //add a sphere to the model
        MeshBuilder myMeshBuilder = new MeshBuilder();
        myMeshBuilder.AddSphere(new Point3D(0, 0, 0), 2);

        GeometryModel3D mySphere = new GeometryModel3D { Geometry = myMeshBuilder.ToMesh(true), Material = MaterialHelper.CreateMaterial(Colors.Pink), BackMaterial = MaterialHelper.CreateMaterial(Colors.Blue) };

        ScaleTransform3D scaletrans = new ScaleTransform3D(2, 2, 2);
        mySphere.Transform = scaletrans;

        ModelVisual3D myMod3d = new ModelVisual3D();
        myMod3d.Content = mySphere;

        view1.Children.Add(myMod3d);
        AddContours(myMod3d, 20, 20, 20);
//end result is the contoured original sphere and not the scaled up version

objo wrote at 2013-04-15 12:45:

I would like to keep the GetContourSegments function as it is - working on a single MeshGeometry3D and not transforming the positions.
To support the transforms I think you should inverse(?) transform the position and normal of the contour plane! I think this is the best choice for performance...
0

Mouse Click

Anonymous 11 years ago updated by Ardahan 9 years ago 2
This discussion was imported from CodePlex

chimou wrote at 2013-06-06 11:09:

Hello,
In my scene I have some cylinder and I want to select one of them by clicking on.

Thank you in advance

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

Try to use a ModelUIElement3D, then you can handle MouseDown events
http://msdn.microsoft.com/en-us/library/system.windows.uielement3d.mousedown.aspx
0
Under review

How to get MeshGeometry3D after applying ScaleTransform3D

KotNitro 10 years ago updated by Øystein Bjørke 10 years ago 1
Hello!
First of all, many thanks for the great toolkit!
My app is simple STL viewer and it also could transform 3d models and apply cutting planes.
So, I make a trnasform:
model.Transform = new ScaleTransform3D(1, 1, 1 / compression);
How can I get an updated MeshGeometry3D? I need it to call MeshGeometryHelper.Cut()
Thank you!
0

Stl Color

Anonymous 11 years ago 0
This discussion was imported from CodePlex

cedre wrote at 2013-03-21 12:09:

Hi,

Thankx for your library !!! So great.

I add a Property Color on StLReader and FileModelVisual3D to set the color of the stl imported File.

and do this on the code : this.Materials.Add(MaterialHelper.CreateMaterial(Brush));
where Brush is my property

Do you think you could add this feature on a next release ?

Thankz

Cedre

objo wrote at 2013-04-15 12:24:

I added a DefaultMaterial property, which should be more general than a color. I hope this is ok!

cedrelo wrote at 2013-04-15 13:08:

Hi,

Perfect!


It will be include in the next release or is it in the source code now?


Thanks so much.

cedrelo wrote at 2013-04-15 13:10:

Ok

i just see your commit of today!!


Thanks

cedrelo wrote at 2013-05-23 11:25:

Hi thanks


It's ok fot stl reader but you not include the defaultMatertial Property to FileModelVisual3D


so we can't do this :
            <ht:FileModelVisual3D x:Name="Vehicle"  DefaultMaterial="{ht:Material Blue}" />


Could you add it in a next release please ?

Thanks

Cedre

objo wrote at 2013-06-07 11:39:

done! I also added DefaultMaterial properties to the .off, .obj and .lwo loaders.

cedrelo wrote at 2013-06-07 11:57:

Perfect!!


Really Thanks

cedrelo wrote at 2013-06-07 12:06:

I added SourceChanged on DependencyProperty DefaultMaterial for works with datatemplate3D
    /// <summary>
    /// The default material property.
    /// </summary>
    public static readonly DependencyProperty DefaultMaterialProperty =
        DependencyProperty.Register(
            "DefaultMaterial", typeof(Material), typeof(FileModelVisual3D), new PropertyMetadata(null, SourceChanged));
0

Error on textured 3DS model load

Anonymous 11 years ago 0
This discussion was imported from CodePlex

LanceJZ wrote at 2012-12-04 00:35:

Here is a screen shot of the error, I was loading up a textured 3DS model using your model viewer sample. The same model exported to obj works. I tried it on a number of models as well, I get the same error. The model has a texture in the diffuse slot.

Screen Shot


objo wrote at 2012-12-04 19:51:

ok, how is a material selected when you have multiple materials with the same name in the file? Use the latest defined material?

Then I think we can simply change the line with error to

this.materials[name] = mg;

objo wrote at 2012-12-13 23:01:

I have checked in the code. Let us know if it is still a problem.

0

UIElement3D and Camera movement

Anonymous 11 years ago 0
This discussion was imported from CodePlex

ddklo wrote at 2011-02-25 12:06:

Hi.

First off, thanks for a great toolkit.

By default IsHitTestVisible is set to "false" on the Viewport3D in the HelixView3D and this causes the UIElement3D's to not fire events. By changing IsHitTestVisible to "true" on the Viewport3D (would also be great if this could be done through XAML) the UIElement3D's fire events, but then it is not possible to move the camera. Do you know how I can have my UIElements3D's fire events and still be able to move the camera around when the mouse is over an UIElemnt3D?

 

Regards

Dagfinn


objo wrote at 2011-02-25 12:53:

hi Dagfinn, I think the CameraController should be modified so we can have IsHitTestVisible=true on the Viewport3D.

I'm not sure how to do this yet - I see the CameraController does not receive mouse events when the mouse is over elements in the viewport. 

Adding it to the issue tracker!

0

two viewports. One master, the other slave

Anonymous 11 years ago updated by ไอยดา สุรีวงค์ 4 years ago 1
This discussion was imported from CodePlex

steunissen wrote at 2011-07-28 11:00:

I have two viewports which should have identical camera positions and properties.

One viewport is used as a "master" in which I manipulate my camera (view point, position etc etc). The other view cannot be manipulated but should follow any camera change I make in the master view.

Possibly there are better solutions and I'd love to hear them, but this is how I solved it now :

I have added a HelixView3D.CameraChanged event to the master view. This copies all camera properties from the master to the slave :

 

NonShadedView.ViewHelix.Camera.Position = ShadedView.ViewHelix.Camera.Position;
NonShadedView.ViewHelix.Camera.FarPlaneDistance = ShadedView.ViewHelix.Camera.FarPlaneDistance;
NonShadedView.ViewHelix.Camera.LookDirection = ShadedView.ViewHelix.Camera.LookDirection;

....................etc.

 

The only thing not working is a change in Field of View.

I cannot find which property defines the Field of View. Possibly it is not set as public ?

Any help appreciated.

Sander.


steunissen wrote at 2011-07-29 13:03:

Found the answer myself:

reference the camera as a perspective camera and you are good to go ! The field of view property is available

 

Sander.


objo wrote at 2011-09-14 09:25:

see the new ContourDemo, it is using master-slave views.

0

Marching cubes

Anonymous 11 years ago 0
This discussion was imported from CodePlex

ADemo wrote at 2012-12-27 17:55:

Can we create a 3D isosurface (using Marching cubes or an other algorithm) with this fabulous library ? 

If no... I can find this algorithm some where but... what have we to do to connect the results to modelvisual3D ? 

Thank you for your answer

0

InputBindings with overlapping controls

Anonymous 11 years ago 0
This discussion was imported from CodePlex

anwil wrote at 2012-03-15 15:24:

I have problems getting inputbindings to work if helixviewport is under other controls, that is, helixviewport is on the bottom of z-order. Reason for this is that I want to have some semi transparent controls to overlap the 3d viewport.

Any ideas how to solve this are greatly welcome... cheers!


objo wrote at 2012-04-05 01:51:

sorry, I am not sure how to solve this.. Let me know if there are errors in the inputbinding implementation!


anwil wrote at 2012-04-05 07:47:

I don't think this has not so much to do with Helix inputbinding. I ended up solving this by routing the events from overlapping controls directly to helixviewport.

0

MeshBuilder.AddTube

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

xjindf wrote at 2013-09-28 15:50:

When the path turning point less than or equal to 90 degrees, the tube is not a smooth transition, such as: Path = "0 0 0 0 2 0 0.5 4 0 0.9 3.5 0", looking forward to your answer, thank you!

objo wrote at 2013-09-29 09:01:

RIght, the extrusion algorithm is very simplified and will not work well with sharp angles.
It would be very interesting to see improvements to this implementation!
See how the joins are solved in the GLE Tubing and Extrusion library (GPL).
I am not aware of any .NET implementations.