Skip to content

pytha.create_modulated_profile

fabian-flassig edited this page Jul 31, 2026 · 2 revisions

Creates a modulated profile in PYTHA as new part. It uses an element handle to a face-part (e.g. a polygon) as its base cross section and a 2D modulation curve as the profile cross section.

Similar to the modulated profile variant in the PYTHA user interface.

pytha.create_modulated_profile(base_part, options)
Parameter Type Description
base_part element_handle The face (or faces) in the base part is used as the base cross section of the profile.
options {...} Table with modulation settings and common element options such as name, material or pen.

Options

Option Type Description
modulation_points {{x,y}, ...} Coordinates of the modulation curve. The origin of the modulation curve is 0,0.
closed string or boolean Determines whether the modulation cross section is closed. Use "closed", "open", true or false.
modulation_type string Optional modulation mode. Use "multiplicative" or "additive". If omitted, "multiplicative" is used.

Return value

Type Description
{element_handle, ...} A table containing the element handles of the newly created parts. Often it is just one element.

Example

local profiles = pytha.create_modulated_profile(base_part, {
    closed = "open",
    modulation_type = "multiplicative",
    modulation_points = {
        {0, 0},
        {10, 0.4},
        {25, 1.0},
        {40, 0.2}
    }
})
local additive_profiles = pytha.create_modulated_profile(base_part, {
    closed = "closed",
    modulation_type = "additive",
    modulation_points = {
        {0, 0},
        {15, 5},
        {30, 0},
        {15, -5}
    }
})

Notes:

  • The base_part is not deleted.
  • If base_part contains multiple faces, profiles over all faces will be created.
  • The modulation points are specified directly in the local 2D modulation coordinate system.
  • The reference point of the modulation profile is fixed at 0,0.
  • The function does not take a separate height parameter. The profile height and shape are defined by the modulation points.
  • At least two modulation points are required.
  • For straight or rounded profiles with a scalar height, use pytha.create_profile.

Version Support:

Minimum PYTHA Version: V26

See also:

pytha, element handles, create_profile, create_polygon, create_sweep

Clone this wiki locally