0
Under review

How to adjust line thickness

Michael Powell 6 years ago in Question updated 6 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
I'm not sure "TubeVisual3D" wouldn't be a better choice for the arch itself, but I am unfamiliar with how to persuade the end points, angles, and so on.

For the moment, I have managed to cobble together some PipeVisual3D segments, but then there's an issue I'd like to smooth the edges of the arch group., which again, a single TubeVisual3D object might be a better fit.

var archPoints = CalculateArcPoints(new Point(),
crossBarArchRadius, 16, 90d).ToArray();

var archThreeDeePoints = archPoints
.Select(p => new Point(p.X, p.Y + paddingHeight)).ToArray()
.Select(toThreeDeeTransform.Transform).ToArray();

var archGroup = new ModelVisual3D();

foreach (var archPipe in archThreeDeePoints
.Take(archThreeDeePoints.Length - 1)
.Zip(archThreeDeePoints.Skip(1),
(a, b) => new PipeVisual3D
{
Fill = postFill,
Point1 = a,
Point2 = b,
Diameter = crossBarDiameter
}).ToArray())
{
archGroup.Children.Add(archPipe);
}

You can see what's going on here. It's easy enough to add more segments, 32, 64, 128, etc, but that's more objects to render. If I can do the same thing with a single TubeVisual3D, that's what I want.



And now with a persuaded TubeVisual3D.



var tube = new TubeVisual3D
{
Fill = postFill,
Diameter = crossBarDiameter,
Path = new Point3DCollection(archThreeDeePoints),
IsPathClosed = false,
};

Very spiff indeed!
I think I see what's going on re: orientation, and it makes sense when you pause not to over-think it.

X is depth, front/back, Y is lateral, left/right, and Z is, of course, height, up/down.

In these attempts, I have my X and Y reversed, at least if you consider the kicking plane of the goal post to be front.
Under review
This is cool! You should write a blog about this. Are you going to publish it as open source? It could be included as an example in this project!
These are compelling thoughts. I will give it some consideration.