How to Draw a Funnel

Jun 25, 2014 at 12:38 AM
I wonder if anyone could suggest an approach to drawing a funnel?
Coordinator
Jun 25, 2014 at 7:55 AM
See the usage of MeshBuilder.AddSurfaceOfRevolution in the example Source\Examples\WPF\ExampleBrowser\Examples\BuildingDemo\SiloVisual3D.cs, I think a similar approach can be used to model a funnel.
Jun 25, 2014 at 11:59 AM
Thank you very much. I have been using Helix for several months in an application that is designed for the residential construction market. I would rather not publish the results yet but if you would send me a direct email, I will share a number of screen shots with you. I am most grateful for your work and "brag" about both Caliburn Micro and Helix (which are both in the same class of excellence) at each of the Microsoft meetings that I attend.

Bob
Jun 26, 2014 at 2:15 AM
Hello objo,

Thank you for your suggestion, I should not have much trouble creating a FunnelVisual3D. But I have hit a real snag. I work in VB rather than C# so I need to write my own version of theSiloVisual3D. However, I don't understand the lambda contained in the Dependency property, shown below.
public static readonly DependencyProperty DiameterProperty =
      DependencyPropertyEx.Register<double, SiloVisual3D>("Diameter", 40, (s, e) => s.AppearanceChanged());
My version for VB will look about like this: (However the lambda is not quite right)
Public Shared ReadOnly DiameterProperty As DependencyProperty =
     DependencyPropertyEx.Register(Of Double, SiloVisual3D)("Diameter", 40, Function(s, e) s.AppearanceChanged())
I'm not asking for you to fix my code, but rather to help me understand the C# version, so that I can fix the VB version myself.

Once I master SiloVisual3D (in VB) I fully expect to create an entire library of specialized visuals for my needs, so getting past this snag is kind of important for me.
Now that I see this example from Building Demo, the funnel shape should not be to hard.

Bob
Coordinator
Jun 26, 2014 at 3:43 AM
Sorry I don't know how to write the lambda in VB.
But you could change to standard dependency property registration with DependencyProperty.Register, see http://msdn.microsoft.com/en-us/library/ms750428(v=vs.110).aspx
Make sure you add the property changed calback to the metadata.
Jun 26, 2014 at 3:15 PM
Edited Jun 26, 2014 at 3:15 PM
Bob,

Try:
Public Shared ReadOnly DiameterProperty As DependencyProperty =
     DependencyPropertyEx.Register(Of Double, SiloVisual3D)("Diameter", 40, Sub(s, e) s.AppearanceChanged())
(because the lambda is supposed to be a function returning "void" (in C# terms) and in VB, that's represented with a Sub() lambda instead of a Function() )
Jun 26, 2014 at 3:45 PM
DOH!
Would you believe that I spent the better part of a day because I forgot that rule.
Thank you very much Rob