2023-02-05 12:20 PM - edited 2023-02-05 12:21 PM
I would like to use a single dynamic hotspot to create Parameter length values in an array which are centred on on an origin point.
PtA[n] ----- PtC[n] ----- PtB[n]
< Length[n] >
PtC is the fixed centre point / origin. PtC take precedence over Length
PtA to PtB is the required Parameter Length
I have tried all the variations I can think of including editable Base Point. I can solve the problem by using PtC as the Base and a bit of simple maths and Parameter Script coding to set Length, but this means I need a second array to handle manual entry of the Length parameter. I am trying to eliminate having two arrays for basically one parameter.
Any suggestions? Is this even possible?
2023-02-06 02:36 AM
If the position of PtC never changes and it is always in the centre, I am not sure it will be easy.
And I am not sure if I will explain it well, but I will try.
You can easily adjust the overall length, and have PtA and PTB as the base (at the same time with a additional attribute of +256 for the base hotspot).
This will alow you to adjust from either end, with the other end as the base point.
The thing is, this will want to move the centre point, but it doesn't have to if you have scripted the line (or what ever it is) so it calculates the length from that centre point.
That just means the point you are stretching the length to, will not be the actual end point of the line.
It is just a value you are using for the overall length, you won't be able to snap to another point to set the length as you are not equally adjusting length PtA-PtC.
As soon as you let go of the hotspot, PtA and PtB will re-center about PtC, so it will be the correct length, just not to the end point you are stretching to.
It would only work if you allow the centre point to move as well.
If you want PtC as the stretchy base point, you would need to parameters for 'length_PtA_PtC' and 'length_PtB_PtC' and do calculations to get 'length_PtA_PtB'.
You could then stretch either end, but you are not stretching the overall length.
Again you can script it so PtC stays fixed and PtA & PtB will reset after you let go of the hotspot.
However, you can even have the PtA & PtB moving hotspots show the value of the overall length using the additional 'displayParam' option for the moving hotspot.
But I am not sure if that will make sense, as you will be moving PtC-PtB and showing PtA-PtB in the info box as you stretch.
And if PtC stays fixed, the PtA or PtB that you are stretching will not be the actual point you are stretching to.
I guess really that is what I am trying to explain.
If PtC stays fixed, the the point you are stretching PtA or PtB to will not be the actual points for A & B when you let go of the hotspot.
2023-02-06 10:38 AM
Thanks for your input Barry, I should have mentioned in this particular case Pts A & B need to be capable of being visually stretched to align with an adjoining object. PtC is aligned with a centre connection and A & B are pulled to match the connecting width.
I know I am probably pushing the AC boundaries again, but the more I think about it, the more cases I can think of in symmetrical objects that pulling from the centre would be a better solution. Even adjusting something as simple as a washbasin or toilet width; currently I think they are all just A / B box stretches.
Perhaps @Peter Baksa could shed some light on a solution or consider a wish to adapt Hotspots to report a mathematically adjusted Hotspot length to the adjusted Parameter?
2023-02-06 11:35 AM
If C stays in a fixed position and A & B are equal on each side, then it can be done.
I have done it with my vanity mirror.
Otherwise you could have a 'length_A' and 'length_B', both with their base at C, that can be adjusted independently.
But then C would not be in the middle.
You would have to re-calculate C to get the middle distance and then apply that to both 'length_A' and 'length_B', changing their values, so C is in the middle again.
I think that will be the tricky bit.
2023-02-06 12:51 PM
That's how I have it at the moment Barry, the frustration from my side is I am using arrays to store the connections. In this particular object there are 10. Where the arrays unravel is the interface. The dynamic hotspot 1/2 Length Parameter currently has to be in a separate array to the full Length Parameter which is available to set manually in the Interface Script, otherwise you can't use GLOB_MODPAR_NAME to detect the changed values in the arrays and correctly adjust the other value e.g. Lfull x 0.5 OR Ldyn x 2.0. The full Length Parameter is also needed in other functions e.g. labels & macros.
I have a potential object where the number of connections may be significantly higher, and the ability to set the Length Parameter without two arrays would be a lot easier to manage.
2023-02-07 05:12 PM
You can have many hotspots on the same parameter, in any directions. Maybe technically even angle and stretch too, but that doesn't make sense 🙂
The half width and the full width have to be different parameters if either of hotspot, input or listing is needed on both.
How significantly higher would the connections be? 100 doesn't matter for a computer nowadays, but a user would need a long time dragging all those hotspots.
2023-02-07 05:59 PM - edited 2023-02-07 06:01 PM
Thank you for commenting & the confirmation. The new object would be less than a hundred points, but it would only be localised editing from default to avoid clashes in the real world. I wouldn't wan't to move them all individually either!
I do think it would be handy if there was a way to have a dynamic hotspot use the base point as a midpoint to the stretched parameter by assigning a flag to double the displayed & saved parameter value.