I have a dynamic component that is going to be part of a dynamic conveyor. I have managed to make it in five pieces lower flat, lower corner, incline, upper corner, and upper flat. The component expands and contracts its lower, upper and incline parts correctly by the attributes assigned to them. However, when I attempt to move the final component on the Y axis, it move double the amount called for. It shows Y positions for all components as having changed by 10, but the actual location is changed by 20. I have rebuilt this several times and cannot get it to move correctly.
Here is the file.
DynamicSideRail.skp (204.4 KB)
When I merely move the whole component up on the blue axis, it splits apart.
That indicates that you are trying to positioning the right end components absolutely, rather than relative to the overall component origin, or the position of the right corner of the RightSideIncline.
On top of that, you’ve just miscalculated the X position of most of the components and the formulae you’ve entered are partially wrong. Position the parts relative to the overall origin, moved right (along X) by the sum of the lengths (LenX) of the component(s) to their left.
I’ve edited the formulae so they position the parts correctly in the X direction.
I’ve added a fudge factor of 1.81" because that is the distance between the origin of the RightSideLowerCorner component, and the origin of the RightSideIncline component - in effect, the width of the top of the corner component.
Why does the corner component need to have any width at the top at all? I don’t see that it needs it, and you would then not need the ‘fudge factor’ added in to account for it.
You don’t need to position them in the Y direction - that can just stay as where you put them (effectively, Y=0).
Your Z position calculations were mostly correct, but not always.
And I’ve replaced the name of the parent component just by
parent. That means that if you later add a left side component, but attach the Component Options to a common parent component, you don’t have to duplicate it.
Is it your intention to add a left side, and an option to set the overall width of the conveyor?
I’m not clear what you were referring to in your original post when you talked about a Y value having changed by double what you expected.
As I’ve recalculated the formulae, you can now move the whole component anywhere you want and it now all hangs together. If you want to set the overall position via a Component Option, you can now do so by setting a CustomY position option, and setting the overall component (RightSideRail) Position Y to that value.
Here’s the component, with all the attributes fixed so it works properly in response to the Component Options, saved back to SU v2020.
DynamicSideRail JWM.skp (254.7 KB)
Is there any reason why you can’t just mirror the RightSideRail to create the LeftSideRail, and incidentally, drop Right and Left from the names of all the components?
Assuming, that is, that the left and right sides will indeed be mirror images?
PS. A further thought.
Why don’t you make the slope an attribute of the parent component, replace the 35 degrees by the attribute, and (optionally) make it a component option?
Wow! That was fast. Thank you. I’ll go over it and see how you fixed it. I had tried to link each portion of the component to the last so they grow from that point, but I must have missed something.
As for why the angle isn’t a parameter, I found the creation of the corner pieces easier than just connecting the to straight adjoining sides and trying to calculate the boundries. With fixed corner pieces, I would have to have several corners, one for each angle choice. Not terrible, but not in my vision until I get the first whole conveyor done.