0

How to Draw a Funnel

Anonymous 10 years ago 0
This discussion was imported from CodePlex

AQSRanck wrote at 2014-06-25 02:38:

I wonder if anyone could suggest an approach to drawing a funnel?

objo wrote at 2014-06-25 09:55:

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.

AQSRanck wrote at 2014-06-25 13:59:

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

AQSRanck wrote at 2014-06-26 04:15:

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

objo wrote at 2014-06-26 05:43:

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.

RobPerkins wrote at 2014-06-26 17:15:

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() )

AQSRanck wrote at 2014-06-26 17:45:

DOH!
Would you believe that I spent the better part of a day because I forgot that rule.
Thank you very much Rob