Hello good GC Community,
I'm designing an objetc, that I'm gping to share once I'm done, but the thing is that I'm simulating the mechanism of this object. And it has a component that rotates on an axis, much like a door knob.
Is it possible to do this in GC?? To define a rotatiing axis?
I've been looking in the nodes and techniques but I cannot find the solution.
P.D: (I know I just made a question recently, but I'm so into learning this that questions arise all the time)
The way to implement rotation is best done by using CoordinateSystem nodes. One provides the reference for the rotation and potentially also the origin for the rotation. The second CoordinateSystem is placed on the first one (or on the "Origin" point, using either ByOrginRotationAboutCoordinateSystem or ByUniversalTransform.
CoordinateSystem.ByOrginRotationAboutCoordinateSystem is useful for rotation around a single axis. It requires input of (1) an Origin (Point, Plane, CoordinateSystem, or other nodes implementing the IPoint interface), (2) a CoordinateSystem that provides the reference for the rotation, especially the Axis orientation around which the rotation occurs, and the reference for the rotational angle, (3) the RotationAngle, a value measured in degrees (360° for a full circle), positive orientation follows the mathematical orientation (counter-clockwise when looking down the rotational axis, for negative rotation values clockwise), and (4) selection of the Axis of rotation in reference to the CoordinateSystem provided under (2).
CoordinateSystem.ByUniversalTransform permits rotation about all three axis (X, Y, Z) at the same time. It is more versatile but also requires more inputs. Once placed in the Graph, it is quite easy to explore. It also permits provision of an optional "Origin" input (again an IPoint), which means that while it requires a CoordinateSystem to determine the orientation of the UniversalTransform, it still could be placed elsewhere in the geometric model.
I hope that this provides sufficient information to take the next step.
Answer Verified By: Rafael Bombardiere Carvajal
Thank you Volker!!!
This helped me a lot, it's a new way for me to manage rotations.
I was able to solve the rotation by defining a coordinate system on a line by parameter, and the line was between 2 points, one of the points by parameter on a circle.
I am glad that I could help.
I have plane rotated.
now I wanna rotate a polygon.
how can I rotate polygon ?
You rotate a polygon analogously to how you might have rotated your plane. In any case, if the polygon is modeled based on a CoordinateSystem, you'd use either this or another one with "ByUniversalTransform" technique to rotate the polygon. Alternatively you could use CopyTransformGeometricContents to generate a rotated copy of your original polygon on the rotated coordinate system.