5 axis AB angle generation issue

I fixed my little plus/minus angle problem using the sign (+ or -) of the Dot Product (DProd). It all looks great!

Then I compared it to your original post yesterday. Other than the pen being more accurate now, can you spot the big difference?

Original:

5_AXIS_SIM_2019Nov30a-orig

Today’s version: (Nov30a)

5_AXIS_SIM_2019Nov30a-Nov30c

I’ve been around the block a few times trying to understand how that happened and if I need to fix it, without any great insight. I think it’s likely that the original orientation of these two parts can be rotated to fix this issue, if necessary. The orange block (‘oBlk’) needs to be redone anyway to fix the cockeyed alignment mentioned in my previous post; my repair hack is approximate and it appears to slightly intersect the adjacent purple block (‘pBlk’).

Here is the code:


5_AXIS_SIM_2019Nov30a.gh (497.8 KB)
(NOTE: version below exports geometry: 5_AXIS_SIM_2019Nov30b.gh)

The Simulation cluster got much simpler to my eye. This approach appears to be sound and comprehensible, even if further adjustments are necessary. The gist of my waking thoughts is in these two groups. The first one gets X, Y and Z, the second one gets angles A and B.

I ditched “Pen Line” and replaced it with a numeric constant, ‘Pen Length’ (120.8659725) in a small white group with another constant found in the code, ‘Z_CONST’ (87.0).

This is the full context with Create Pen being the only internal cluster remaining. (full size)

I think it would be a good idea to refactor a little further to export all the geometry so that Preview and baking of each piece can be done separately, outside the Simulation cluster.

P.S. Went ahead and exported geometry from the Simulation cluster. ‘Preview and Bake’ are now in the green group below:


5_AXIS_SIM_2019Nov30b.gh (501.8 KB)