Skip to content

math_Vector.Set have TypeError #1426

Open
@tnakaicode

Description

@tnakaicode

Description:

The math_Vector.Set method throws a TypeError when attempting to set values in Python. The error message indicates that the wrong number or type of arguments is being passed to the method. This issue occurs even when the arguments appear to match the expected usage based on the C++ prototypes provided in the error message.

Environment:

  • Library: pythonocc-core
  • Version: 7.8.0
  • Platform: Windows
  • Python Version: 3.11.9

Sample Code:

from OCC.Core.math import math_Vector

# Initialize a math_Vector with a valid range
nb_variables = 3
starting_point = math_Vector(1, nb_variables, 1)

# Attempt to set values
starting_point.Set(1, 1.0)
# TypeError: Wrong number or type of arguments for overloaded function 'math_Vector_Set'.
#   Possible C/C++ prototypes are:
#     math_VectorBase< double >::Set(Standard_Integer const,Standard_Integer const,math_VectorBase< double > const &)
#     math_VectorBase< double >::operator =(math_VectorBase< double > const &)

starting_point.Set(1, 1, math_Vector(1, 1, 0))  # succese
starting_point.Set(1, 2, math_Vector(1, 1, 0)) 
# RuntimeError: Standard_RangeErrormath_VectorBase::Set() - invalid indices raised from method Set of class math_VectorBase< double >

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions