N point registration _ moving entities errors

For n point registration, i can enter a list of parts, separated by comma
or enter individual entities
but cannot include all entities, separated by comma
what’s wrong with this?

entities1=trimatic.get_parts()
entities2=trimatic.get_planes()
entities3=trimatic.get_points()
trimatic.n_points_registration(fixed_points=(fixed01,fixed02,fixed03),moving_points=(moving01,moving02,moving03),moving_entities=(entities1,entities2,entities3))

Traceback (most recent call last):
File “C:\Users\OMS\Desktop\head_position_step2.py”, line 44, in
trimatic.n_points_registration(fixed_points=(fixed01,fixed02,fixed03),moving_points=(moving01,moving02,moving03),moving_entities=(entities1,entities2,entities3))
File “C:\Program Files\Materialise\3-matic Research 13.0 (x64)\trimatic\align\n_points_registration.py”, line 20, in n_points_registration
trimatic.utils.check_type(“moving_entities”, moving_entities, (trimatic.Part,) + trimatic.utils.analytical_primitive_types(), True)
File “C:\Program Files\Materialise\3-matic Research 13.0 (x64)\trimatic\utils\type_validation.py”, line 29, in check_type
raise ValueError(warning)
ValueError: Parameter moving_entities does not have the right type at index 2, use a <class ‘trimatic.data.types.Part’>, <class ‘trimatic.data.types.Point’>, <class ‘trimatic.data.types.Line’>, <class ‘trimatic.data.types.Arc’>, <class ‘trimatic.data.types.Plane’>, <class ‘trimatic.data.types.Cylinder’>, <class ‘trimatic.data.types.Cone’> or <class ‘trimatic.data.types.Sphere’>.

Hi Teddy,

Thank you for reaching out to us regarding this issue.

Return of entities1, entities2 and entities 3 are tuples of parts, planes and points, e.g. return of entities1 is (point1, point1, point3), return of entities2 is (plane1, plane2, plane3).
This does not fit the type of requirement needed for moving entities as indicated by the ValueError.
To solve this, you can list all of them in one list and use this list as the moving entities, example as below:

entities1=trimatic.get_parts()
entities2=trimatic.get_planes()
entities3=trimatic.get_points()

list_moving = [ ]
list_moving.extend(entities1)
list_moving.extend(entities2)
list_moving.extend(entities3)

trimatic.n_points_registration(fixed_points=(fixed01, fixed02, fixed03), moving_points=(moving01, moving02, moving03), moving_entities=list_moving)

Could you try this and let me know if it works?

Kind regards,
Imanina

1 Like

Yes, Imanina.

Thank you very much for your prompt reply. It solves my issue perfectly. Thankkkkkkk

1 Like