Let me start off by explaining the issue that spawned the creation of this component and finding these bugs. I’m working at a company that manufactures extruded profiles for walls and SketchUp is a program that shows great potential in allowing us to create a process that streamlines our workflow by generating our products through dynamic components and then exporting the data through the “Generate Report” tool in SketchUp into Excel which would automatically fill out technical sheets based on the data SketchUp supplied. However, a major issue in regards to this process is SketchUp’s inability to define if a components axis has been inverted (which happens when you mirror a component). This issue would thus result in the duplication of any extruded profiles with angled cuts (besides that of 0°) rather than producing two (or more) profiles with inverted machining.
This caused me to craft a component (an inserted Child to a Parent Component) that would allow me to detect if the component was mirrored or not by producing 4 points (X+, X-, Y+, Y-) that would extract their Global X and Y coordinates based on its Parents X,Y coordinates and Z rotation. These global coordinates could then be compared with one another to determine if X+ and X- had been inverted, or if Y+ and Y- had been inverted thus defining if the component had been mirrored or not.
I crafted the component with visual references that caused X+, X-, Y+, Y- to always point towards their Global Axis, however, this is what led me to the discovery of the aforementioned bugs:
1: SketchUp’s Dynamic Component Rotations don’t update when rotated and must instead be moved in order to trigger an update
2: When imputing constraints into a dynamic component, the rotation interface changes from ‘0’ to ‘0.0’. The original ‘0’ version is capable of caching the rotation of the component and updating once moved (as explained in the previous bug), however the constrained ‘0.0’ version does not cache this data and thus reverts the component back to its original direction once the block is moved.
3: SketchUp’s Dynamic Components convert their rotational values to a range between -180 to 180 rather than 0 to 360, this in turn can cause various issues when using the DC Trig Functions in conjunction with others such as the ‘ABS(absolute value)’ function as any value between 180 to 360 will revert to -0 to -180 (This may be more for convenience sake than an actual bug, but It can become rather annoying)
4: SketchUp Determines a DC’s Z rotation value based on the direction the DC’s X axis is facing. So, when mirroring a component over the Y axis, the DC’s X axis faces in the opposite direction, resulting in a DC Z rotation of -180. However, when mirroring over the X axis, the DC’s X axis stays in the same position, resulting in a DC Z rotation of 0 (in other words, absolutely nothing changes in a components information when mirrored over the X axis, however, its geometry is inverted)
5: Continuing on with the last bug… When mirroring a component, it’s still possible to rotate the block using SketchUp’s Rotate Tool. However, the error arises when manually imputing a value for the DC Z rotation inside the Components Options/Attributes window (after a block has been mirrored - thus inverted), when imputing values here, the components orientation is reverted back to its un-inverted (non-mirrored) state with the X axis pointing in the direction defined in the DC’s attributes.
All in all, SketchUp needs to fix the updating error when rotating a dynamic component, and add an X,Y and Z inversion attribute into their dynamic components in order to resolve the mirroring issues.
PS: If anyone has a solution to my ‘mirror detection’ problem, please leave a comment or suggest an extension as it would be a great help.
Test Block:
Compass Quads.skp (143.4 KB)