Skip to content

math_Vector.Set have TypeError #1426

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
tnakaicode opened this issue Apr 21, 2025 · 0 comments
Open

math_Vector.Set have TypeError #1426

tnakaicode opened this issue Apr 21, 2025 · 0 comments

Comments

@tnakaicode
Copy link

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 >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant