In Palermo, Italy, I'm an active member of a Yoga Center. We decided to create an artistic panel to decorate one of the walls of the Center. Our tea room has many ellipse-shaped volumes.
So I designed a panel with the same pattern to propose to the Yoga group using Fusion 360. This is a draft I created with the Fusion User Interface:
It should be made up of a certain number of ellipses that are inside one another but tangent in two points and rotating at a certain angle. They should create an illusion of a spiral!
The idea is to build this panel with a laser printer to carve it into wood.
I liked the idea so much that I decided to write a script to make it into a precise form. I thought I would be simple work !
If you look at the picture carefully, you can see some errors due to the use of the Fusion User Interface. Can you spot them?
The ellipses do not touch each other (this can generate problems during the print phase). So I tried to solve these mistakes using some solutions through the script, trying to find the exact tangent points.
The construction of the whole panel derives from the building of a set of ellipses rotated and enlarged to become internal tangents to the previous ellipse. The tilt (ALPHA) of the ellipses depends on the number of ellipses that one wants to create in a cycle of 360°.
Therefore the first step was to implement a function using the Cartesian equation of an ellipse whose major axis is rotated of a certain angle to the Cartesian axes. In other words, it was necessary to use the mathematical equation to obtain the information needed for the construction of an ellipse inside the Python script with the method: sketchEllipses_var.add(centerPoint, majorAxisPoint, point).
Such method requires the center of the ellipse, the point which represents the major axis and a generic point of the ellipse (I chose the point connected to the minor axis). The rotated ellipse is built on a new sketch. The two ellipses have been named EL1 and EL2.
Almost tangent ellipse
What we want to realize now is the construction of an ellipse with the same tilt of the rotated ellipse EL2 but tangent to the previous ellipse EL1.
To find a solution from the mathematical point of view is rather difficult, so I tried to solve the problem using the computer graphics tools provided by the Fusion API and Python scripting.
As far as I know, building an ellipse concentric and tangent to EL1, starting from EL2, is not possible, because Fusion changes the direction of the axis and does not change its dimension. So it superimposes the two ellipses.
We need to maintain the axis of the ellipse fixed and enlarge its dimension until it becomes tangent to the original ellipse. All this has been developed using the Offset method of the Sketch Object, applied to the rotated ellipse EL2: sketch_var.offset(curves, directionPoint, offset).
The ellipses EL1 and EL2 intersect in 4 points. With a 'for cycle' and an offset operation we can extend the ellipse EL2 until there will be no more points of intersection with EL1. In this way we build an ellipse that is an approximation of an ellipse tangent to EL1.
The problem seems to be solved! I just need to delete all the intermediate ellipses and leave only the last one and the game is done … but it is not so easy!
There are two more questions:
The second observation, particularly, forced me to better analyze the curves that I created.
A SketchFittedSpline, which looks like an ellipse, doesn’t have the same features:
To create a curve tangent to EL1 ellipse I need to convert the SketchFittedSpline SFS1 to a SketchEllipses. This has been done extracting the main features of SFS1 so that I could use the sketchEllipses_var.add(centerPoint, majorAxisPoint, point) method.
In order to find the major axis vertex, I found the intersection of SFS1 with the ellipse axis. The other necessary point was found as an intersection of SPS1 with the X axis. In this way I can approximate the SFS1 with a SketchEllipse (EL3)
Now it's possible to make EL3 (defined with the variable real_ellipse in the script) perfectly tangent to the EL1 ellipse. To do so,first I need to constrain EL3 to be concentric to EL1 with sketch2.geometricConstraints.addConcentric(real_el
In the following picture, the constraints used to constrain EL3 to be concentric and tangent to EL1 are visible:
The basic work is completed. Now I need to repeat the whole process in a loop so that the ellipse EL3 will become the new EL1, starting point for the next step. At the end I will have as many sketches as the created ellipses.
In each sketch there are two ellipses: the copy of the original ellipse (EL1), green colored because it is fixed, and the tangent ellipse EL3, built to the i-th step.
Selection and Extrusion
What is left is to create the panel selecting the profiles that I am interested in. I chose to select the external profiles for each ellipse, skipping one every other step.
The very last step is the extrusion of all the profiles with the desired thickness so that I can obtain the final result.I can act on the number of ellipses to obtain a denser or more transparent panel. The final effect is to obtain a couple of more or less detailed spirals. The spirals that I have obtained are of a logarithm type.
I chose to create only one 360° cycle, but I could implement the algorithm with more cycles obtaining more complex spirals.
Another choice has been to relate the major axis with the minor axis through the golden number 0.618. I can avoid using this relation making the first ellipse more distorted and elongated and unbalancing the relationship between the major and the minor axes. In this way I obtain a panel more elongated in a direction.
One of the examples has been rendered attributing the Mahogany-Glossy material:
At the moment, the model has only a small third dimension (almost 1 cm) because the panel has only a 2D pattern.
I also tried to project it in a 3D space to see other effects and here are a couple of examples.This last phase was not implemented inside the script since the original main goal was to create a decorative panel.
For the construction of the 3D models you can refer to the article I authored where you can see the extrusion and intersection with a solid of revolution created with a revolve operation applied to the geometry of a vertical sketch:
These are the sketches with which I built the previous examples.
My name is Dino Coglitore. I am a teacher of ICT at a secondary technical school in Palermo (Sicily-Italy) - ITI Vittorio Emanuele III
I started working with Fusion some months ago. With the help of Dario Passariello of Digital3D (Autodesk Academic Partner e Certified Instructor, Autodesk Expert Elite). I did the work of solid modelling. My passion for programming and graphics convinced me to use Python and the Fusion API to try and express my creativity.
I want to thank @ekinsb and @yqliu who let me better understand the difference between SketchEllipse and SketchFittedSpline objects. One more thank you to @ekinsb who helped me to use the API to find the ellipses intersections.
A special thank you goes out to Claudia Di Stefano who is my 'translation advisor'. Thank you Claudia.
IMPORTANT: Access to Python Script
If you have questions or any doubt about the script development, please do not hesitate to contact me here on Autodesk Community ( @dinocoglitore )
I would be glad if my experience could be of any use for the community.
I would really appreciate any suggestions, criticisms, comments and proposals for further improvements.
The Python code and the proposed 3D models are available to anyone who might be interested. Please post a comment below and I will send the link to access the Python script code. You may also reach out to me directly.
All the best from Palermo. I look forward to your thoughts and comments!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm a ITC teacher in a Technical Institute in Palermo (Sicily-Italy). I followed a course on Fusion 360 on june 2016 and I was thrilled of the possibilities of this kind of software. So I started to apply the 3D modeling on a project in driving a mechanical arm of which I developed the 3D model. My interest is also in programming so I started to study also scripting in Python.
Please review our Idea guidelines and best practices before posting a new idea, or voting on an existing one!