Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Surface Pattern Generator Fails when Part and Part Frame Names Match

#1
The surface pattern generator utility fails if the part name and the reference frame have the same name. To reproduce:
1. Start with the example workstation (attached)
2. Utilities > Surface Pattern Generator > Surface Pattern Generator
3. Use parameters:
Size along X = Size along Y = 100
Step along X = Step along Y = 5 
Cover all surface = Distribute lines evenly = Connect lines = False
Remove points that are not on the surface = True
Repeat times = 1
Repeat offset along Z = 2
4. Click "Ok"
5. Observe failure (snipped below)
6. Observe that part model has been deleted from workstation

Code:
The add-in application has stopped unexpectedly.

Executable: C:/RoboDK/Addins/com.robodk.app.surfacepatterngenerator/SurfacePatternGenerator/SurfacePatternGenerator.py
Returned code: 1

Error Output (stderr):
Traceback (most recent call last):
File "C:\RoboDK\Addins\com.robodk.app.surfacepatterngenerator\SurfacePatternGenerator\SurfacePatternGenerator.py", line 90, in <module>
runmain()
File "C:\RoboDK\Addins\com.robodk.app.surfacepatterngenerator\SurfacePatternGenerator\SurfacePatternGenerator.py", line 78, in runmain
new_obj = CreatePaths(REF, PART, S.SIZE_X, S.SIZE_Y, S.STEP_X, S.STEP_Y, S.REPEAT_TIMES, S.REPEAT_OFFSET, S.COVER_ALL, S.EVEN_DISTRIBUTION, S.CONTINUOUS, S.ANGLE_TRIANGLE, S.REMOVE_UNPROJECTED_POINTS)
File "C:\RoboDK\Addins\com.robodk.app.surfacepatterngenerator\SurfacePatternGenerator\_spgtools.py", line 191, in CreatePaths
pti_proj = Pose_x_XYZijk(pose_part_wrt_ref, proj_point)
File "C:\RoboDK\Addins\com.robodk.app.surfacepatterngenerator\SurfacePatternGenerator\_spgtools.py", line 32, in Pose_x_XYZijk
new_xyz = pose * xyzijk[0:3]
File "C:\RoboDK\Python\robodk\robomath.py", line 1513, in __mul__
raise Exception(MatrixError, "Invalid product")
Exception: (<class 'robodk.robomath.MatrixError'>, 'Invalid product')


Output (stdout):
Loading data from RoboDK station...
WARNING: Invalid/unknown parameter to get: Surface-Pattern-Generator-Settings-Backup
Saving data to RoboDK station...
Working with table ...
Projecting table to surface...
WARNING: Invalid points, a 3xN (or 6xN) list of points must be provided
WARNING: Invalid points, a 3xN (or 6xN) list of points must be provided
WARNING: Invalid points, a 3xN (or 6xN) list of points must be provided
WARNING: Invalid points, a 3xN (or 6xN) list of points must be provided
WARNING: Invalid points, a 3xN (or 6xN) list of points must be provided
WARNING: Invalid points, a 3xN (or 6xN) list of points must be provided
WARNING: Invalid points, a 3xN (or 6xN) list of points must be provided
WARNING: Invalid points, a 3xN (or 6xN) list of points must be provided
WARNING: Invalid points, a 3xN (or 6xN) list of points must be provided
WARNING: Invalid points, a 3xN (or 6xN) list of points must be provided
WARNING: Invalid points, a 3xN (or 6xN) list of points must be provided
WARNING: Invalid points, a 3xN (or 6xN) list of points must be provided
WARNING: Invalid points, a 3xN (or 6xN) list of points must be provided
WARNING: Invalid points, a 3xN (or 6xN) list of points must be provided
WARNING: Invalid points, a 3xN (or 6xN) list of points must be provided
WARNING: Invalid points, a 3xN (or 6xN) list of points must be provided
WARNING: Invalid points, a 3xN (or 6xN) list of points must be provided
WARNING: Invalid points, a 3xN (or 6xN) list of points must be provided
WARNING: Invalid points, a 3xN (or 6xN) list of points must be provided
WARNING: Invalid points, a 3xN (or 6xN) list of points must be provided
WARNING: Invalid points, a 3xN (or 6xN) list of points must be provided
Projection failed on some points!

This does not occur if the name of the reference frame is changed.


Attached Files
.rdk   example.rdk (Size: 1.98 KB / Downloads: 52)
#2
Good catch! I just fixed the Surface Pattern Generator Add-in in our public GitHub, and it will be updated on the online library soon.
Please read the Forum Guidelines before posting!
Find useful information about RoboDK by visiting our Online Documentation.
#3
Thanks for the quick turnaround, Sam!
  




Users browsing this thread:
1 Guest(s)