Model.ellipsoid#
- Model.ellipsoid(center, a_dir, b_dir, a, b, c)#
Consider the general equation of an ellipsoid centered at x0, y0, z0 as
\[\begin{split}\\frac{(x - x_0)^2}{a^2} + \\frac{(y - y_0)^2}{b^2} + \\frac{(z - z_0)^2}{c^2} = 1\end{split}\]This ellipsoid’s principal axes are aligned with x, y and z directions. In this command, an ellipsoid is created whose principal axes are aligned in any specified direction. User defined directions are given for the principal axis that is associated with
avalue ina_dir, and the principal axis forbvalue inb_dirvalues. The principal axis forcvalue is determined by the other two directions.- Parameters:
center (hwTriple) – The center location of the ellipsoid.
a_dir (hwTriple) – The principal axis direction associated with
avalue. A vector input is expected.b_dir (hwTriple) – The principal axis direction associated with
bvalue. A vector input is expected.a (double) – The ‘a’ value in the ellipsoid equation.
b (double) – The ‘b’ value in the ellipsoid equation.
c (double) – The ‘c’ value in the ellipsoid equation.
Example#
Create an ellipsoid solid centered at (1,1,1) with principal axis for ‘a’ as (1,1,0), with principal axis for ‘b’ as (0,0,1), a=4, b=5, and c=6 values#import hm import hm.entities as ent model = hm.Model() model.ellipsoid( center=[1.0, 1.0, 1.0], a_dir=[1.0, 1.0, 0.0], b_dir=[0.0, 0.0, 1.0], a=4, b=5, c=6 )