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

SurfacePlotDemo: Points set to Double.NaN cause view cutted

MarcoA 8 years ago updated by ไอยดา สุรีวงค์ 4 years ago 2

I am trying to change the SurfacePlotDemo in which I want to not show a portion of the Points of the Rectangular Mesh. I tried to set the Points to Double.NaN and I can see the surface without the points but the view looks like cutted. The points that I want to exclude are excluded correctly, but the view seems to be cutted at some view angles.



If I rotate the camera the surface is shown correctly
Image 94

Here is the code

  public Point3D[,] CreateDataArray(Func<double, double, double> f)
        {
            var data = new Point3D[Rows, Columns];
            for (int i = 0; i < Rows; i++)
                for (int j = 0; j < Columns; j++)
                {
                    var pt = GetPointFromIndex(i, j);
                    data[i, j] = new Point3D(pt.X, pt.Y, f(pt.X, pt.Y)*10);

                    if (i >= 0 && i < 10 && j >=0 && j < 100)
                    {
                        data[i, j] = new Point3D(double.NaN, double.NaN, double.NaN);
                    }

                }
            return data;
        }


Is the only change with respect to the original example.
If I don't set any point to Double.NaN I see the surface correctly shown at any angle.


I am doing this on Windows 10 64bit, if I try on Win7 32 bit the cutting doesn't happen.


Questions:


Is setting points to NaN the correct way to not create parts of the regular mesh?


Are there any instructions to avoid this cutting?




Regards


Marco

0

HelixViewPort3D: How to Adjust FrameRate

Petar 2013 8 years ago 0

How to improve WPF 3D rendering performance with adjusting FrameRate?

0

Combining Contours

Nathan Smela 8 years ago updated by ไอยดา สุรีวงค์ 4 years ago 1

Heya All,


I want the total contour of a mesh as if viewing from top-down on the z axis.  I grab a contour every 1 mm on the z axis, and then move all points to 0 z-axis.  Is there a method to contour around these points?


private void AddContours(MeshGeometry3D mesh)
        {
            //abort if the mesh is invalid
            if (mesh == null || mesh.TriangleIndices.Count < 3)
                return;


            var bounds = mesh.Bounds;


            List<Point3D> pointmap = new List<Point3D>(); //collects all the points from contouring


            //setting the contour plane

            Point3D plane = new Point3D();
            Vector3D normal = new Vector3D(0,0,1);


            //cycles through the mesh, grabbing a contour at each z interval
            //combines all on 0 on the z-axis
            for (double z = 0.1; z < bounds.SizeZ; z += 0.1)
            {
                plane = new Point3D(0, 0, z);
                var segments = MeshGeometryHelper.GetContourSegments(mesh, plane, normal).ToList(); //calculates the contour 

                foreach (var point in segments)
                   pointmap.Add(new Point3D(point.X, point.Y, 0));
            }


           //convert pointmap to a contour


           //done converting contour

         

            var mb = new MeshBuilder(true, false);
            mb.CreateNormals = false;
            mb.AddPolygon(contour);
            
            var model = mb.ToMesh();


            DisplayModel();
        }


0

Error in SampleProject - Helix Toolkit

P S V Ramaraju 8 years ago updated by anonymous 6 years ago 3

When I am trying one of the example name - SimpleDemo in Helix Toolkit I am getting Invalid Markup. The code is this: It is exactly the same in the helix toolkit project.


Code:


MainWindow.xaml: 


<Window x:Class="SimpleDemo.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:HelixToolkit="clr-namespace:HelixToolkit.Wpf;assembly=HelixToolkit.Wpf"
        xmlns:local="clr-namespace:SimpleDemo"
        Title="SimpleDemo" Height="480" Width="640">
    <Window.DataContext>
        <local:MainViewModel/>
    </Window.DataContext>
    <Grid>
        <!-- The HelixViewport3D supports camera manipulation, and can be used just like the Viewport3D -->
        <HelixToolkit:HelixViewport3D ZoomExtentsWhenLoaded="True">

            <!-- Remember to add light to the scene -->
            <HelixToolkit:SunLight/>
            
            <!-- The content of this visual is defined in MainViewModel.cs -->
            <ModelVisual3D Content="{Binding Model}"/>

            <!-- You can also add elements here in the xaml -->
            <HelixToolkit:GridLinesVisual3D Width="8" Length="8" MinorDistance="1" MajorDistance="1" Thickness="0.01"/>

        </HelixToolkit:HelixViewport3D>
    </Grid>
</Window>


MainWindow.cs


// --------------------------------------------------------------------------------------------------------------------
// <copyright file="MainViewModel.cs" company="Helix Toolkit">
//   Copyright (c) 2014 Helix Toolkit contributors
// </copyright>
// <summary>
//   Provides a ViewModel for the Main window.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace SimpleDemo
{
    using System.Windows.Media;
    using System.Windows.Media.Media3D;

    using HelixToolkit.Wpf;

    /// <summary>
    /// Provides a ViewModel for the Main window.
    /// </summary>
    public class MainViewModel
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="MainViewModel"/> class.
        /// </summary>
        public MainViewModel()
        {
            // Create a model group
            var modelGroup = new Model3DGroup();

            // Create a mesh builder and add a box to it
            var meshBuilder = new MeshBuilder(false, false);
            meshBuilder.AddBox(new Point3D(0, 0, 1), 1, 2, 0.5);
            meshBuilder.AddBox(new Rect3D(0, 0, 1.2, 0.5, 1, 0.4));

            // Create a mesh from the builder (and freeze it)
            var mesh = meshBuilder.ToMesh(true);

            // Create some materials
            var greenMaterial = MaterialHelper.CreateMaterial(Colors.Green);
            var redMaterial = MaterialHelper.CreateMaterial(Colors.Red);
            var blueMaterial = MaterialHelper.CreateMaterial(Colors.Blue);
            var insideMaterial = MaterialHelper.CreateMaterial(Colors.Yellow);

            // Add 3 models to the group (using the same mesh, that's why we had to freeze it)
            modelGroup.Children.Add(new GeometryModel3D { Geometry = mesh, Material = greenMaterial, BackMaterial = insideMaterial });
            modelGroup.Children.Add(new GeometryModel3D { Geometry = mesh, Transform = new TranslateTransform3D(-2, 0, 0), Material = redMaterial, BackMaterial = insideMaterial });
            modelGroup.Children.Add(new GeometryModel3D { Geometry = mesh, Transform = new TranslateTransform3D(2, 0, 0), Material = blueMaterial, BackMaterial = insideMaterial });

            // Set the property, which will be bound to the Content property of the ModelVisual3D (see MainWindow.xaml)
            this.Model = modelGroup;
        }

        /// <summary>
        /// Gets or sets the model.
        /// </summary>
        /// <value>The model.</value>
        public Model3D Model { get; set; }
    }
}


Can someone help me in getting through this?

0

Loading .OBJ 3D files

P S V Ramaraju 8 years ago updated by anonymous 7 years ago 6

Hello!!! I am using helix tool kit for one of my visual studio project i.e, loading 3D models. With that I am able to successfully load stl files. Is it possible to load 3d .OBJ files?? Thanks in advance.

0

I put some useful Helix3D functions in a handy DLL

PUPPICAD 8 years ago updated by ไอยดา สุรีวงค์ 4 years ago 1

These functions extend Helix 3D functionality in the areas of Point3D processing, loft generation and saving to STL. They were developed over three years of working on the PUPPI Toolkit and PUPPICAD. Since Helix was a great help to us, we would like to give back by releasing this free library which we plan to update as more functions are developed.


Get the H3DExtensions library and sample project free here:

http://pupi.co/index.php/h3dextensions


0

Character animation

Ondra Zamec 8 years ago updated by ไอยดา สุรีวงค์ 4 years ago 1

Hi,

part of my thesis is to implement character animation. So I'd like to contribute here and implement it. Problem is, Helix is rather big for a newcommer so I can't navigate in it much. Mainly I would need help with effects for vertex blending. If someone could explain how effects works in Helix, I'd be grateful.


Consequently with that, there should be another class for 3D character which uses that fx file. From what class should it inherit, how should it be designed?


I would greatly appreciate cooperiation from someone who could give me initial directions where to start, what to study. Regarding my knowledge, I have done most things from Frank Luna in Introduction to DirectX11.

0

Shortest distance between two models

SGU 8 years ago updated by ไอยดา สุรีวงค์ 4 years ago 1

Hello,


Is there a way to get the shortest distance between two Model3D objects in a ViewPort3D?

I found Method GetDistanceSquared(Point3D, Visual3D) and it partially do the job if I assign my Model3D to a Visual3D, but I don't have a Point as a reference but another Model3D.


//This is what I used to get the distance Point-Model

ModelVisual3D model = new ModelVisual3D();
model.Content = axis1;  //where axis1 is a Model3D
Distance.Content = Math.Sqrt(ElementSortingHelper.GetDistanceSquared(new Point3D(0, 0, 0), model));


I was thinking that I could get the shortest distance in between all the points from the first model compared with the second model but maybe there is a faster or simpler way to do it with a Method that I'm missing.


Thanks a lot.

0

Mobile Music Videos

semih 8 years ago 0

Tubidy video search system is adapted to a kind of music phones. Today, located in one of the most popular applications on the recent practice among the tubidy mp3. Every day thousands of visitors who practice the day to day more and more visitors are witnessing the rise. This practice increases the Fenomenlig especially helping in the best way the download of all videos that have been watched on YouTube. You can download the iOS and easy way to practice your Android device and the application tubidy advantageous side in no time without loss can start to make the best of it.
Tubidy With this application program is now called the mobile device tracks the entire process of achieving the fastest way you will begin to experience the bliss. Whether you want your smartphone or tablet you can also listen to your music without downloading can begin. Look, we are also now many users spend his life listening to music. In fact, most of the time like the music, Tubidy mp3 s starts to keep the path to the Internet to download. To find a reliable music sites will no longer have a secure music listening pleasure with tubidy program because it is not an easy task in the Internet environment is also a chance to live in the most beautiful way. now you want to be able to search for your favorite songs in the program and will have the chance to listen in with peace of mind without any security threats. Using just wanting an extremely simple program that anyone can use seamlessly.

0

Wireless Headphones and ear buds to experience an enthusiastic running!

Carson Branagh 8 years ago updated 8 years ago 0

Wireless sports headphones have more benefits than the normal one. They are very useful for all gym goers or person who will indulge in any kind of sports. You can use it anywhere like road, train or where you are in workout. These wireless headphones help you to get rid of using mobile in your hand to skip music or keeping a phone in your pockets. It also helps to avoid caught up wires while workout in gym or running. This will perfectly save from tangling of wires. But the hard part is you need to select the good and best working model headphones to get satisfied you. So you need to check patiently before buying any of the wireless headphones or earphones. The perfect pair will reduce your pressure and gives you a feel of flying in the air. You should select the one which sounds good with expected bass and EQ adjustments and some type of designs will surely hurt your ears. You should check properly for your comfortness and fitness for your pretty ears. There are lot more models in markets with wireless features but few come at affordable prices with good features to complete your expectations. You also need earphones to beat the sweat and it needs to be waterproof to use it for sports. So your headphones need to overcome those sweats and also water leaking from bottles.

By analyzing various wireless earphones, some of them works well and good and withstand all this tests. These Headphones are specially designed for running, cycling and lifting weights and also for regular gym workouts. These wireless earphones also help you in attending calls, skipping music and also adjusting volumes without using your phone. It works well on all types of Android devices and works even smoother on phones. If you are in need to select the best wireless headphones then you need to go through its price, sound quality, battery life and design that suits you well.


Image 58


Best that beats the other pieces:


Wireless headphones and ear buds are the best one than wired headphones as these pairs can be used at any time and in anywhere. The beats by Dre powerboats 3 is one among the best wireless one which can even be used very rigorously and still it works well and smooth with same battery life and it won't irritates you with any interruptions. The other best one is JLab Epic 2 which is actually a boon for wireless headphones lovers. This is an incredible one with all exciting features and wonderful design.


Ear buds design that will never fall off!


Ear bud designed with a wire that runs over your ear fits well for all ears and it won't fall easily as you think. Many of the wireless headphones disappoint the consumers in various aspects but these ones really work well and satisfy all the people. Sound quality, comfort, and style are the plus points for these wireless headphones. Powerbeats ear hook design never let it fall and performs well with fast charging and long lasting battery design.