Model.surfacecreatenurbs#

Model.surfacecreatenurbs(udegree, vdegree, uk_count, vk_count, up_count, vp_count, ratnl, double_array)#

Creates generic NURBS type surface using input parameters.

Parameters:
  • udegree (int) – Polynomial degree of u parameter.

  • vdegree (int) – Polynomial degree of v parameter.

  • uk_count (int) – Number of u parameter NURBS knots.

  • vk_count (int) – Number of v parameter NURBS knots.

  • up_count (int) – Number of NURBS control points in u parametric direction.

  • vp_count (int) – Number of NURBS control points in v parametric direction.

  • ratnl (int) –

    Parameter that specifies whether weights are used in addition to control points. Valid values are:

    0 - Use weights

    1 - Do not use weights

  • double_array (hwDoubleList) – The list of the doubles that contains the value of the knots, control points and weights (if ratnl=1).

Examples#

Create a ruled surface connect two parabolas#
import hm
import hm.entities as ent

model = hm.Model()

model.surfacecreatenurbs(
    udegree=1,
    vdegree=2,
    uk_count=2,
    vk_count=2,
    up_count=2,
    vp_count=3,
    ratnl=0,
    float_array=[
        0.0,
        1.0,
        0.0,
        1.0,
        0.0,
        0.0,
        0.0,
        1.0,
        0.0,
        0.0,
        0.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        0.0,
        2.0,
        0.0,
        1.0,
        2.0,
        1.0,
    ],
)
Create a ruled surface connect two circular arcs#
import hm
import hm.entities as ent

model = hm.Model()

model.surfacecreatenurbs(
    udegree=1,
    vdegree=2,
    uk_count=2,
    vk_count=2,
    up_count=2,
    vp_count=3,
    ratnl=1,
    float_array=[
        0.0,
        1.0,
        0.0,
        1.0,
        0.0,
        0.0,
        0.0,
        1.0,
        0.0,
        0.0,
        0.0,
        1.0,
        1.0,
        1.0,
        1.0,
        1.0,
        0.0,
        2.0,
        0.0,
        1.0,
        2.0,
        1.0,
        1.0,
        1.0,
        0.707,
        0.707,
        1.0,
        1.0,
    ],
)