diff options
author | Théo de la Hogue | 2023-10-23 15:00:17 +0200 |
---|---|---|
committer | Théo de la Hogue | 2023-10-23 15:00:17 +0200 |
commit | ecfbc519e518948078b0831ccd0fa8bb18e439cb (patch) | |
tree | 5961599241217c5549cf2e14e1a77fdf456a8bc1 /src | |
parent | d9dc8fc6f542c1ba46cba9d66a741890f946474a (diff) | |
download | argaze-ecfbc519e518948078b0831ccd0fa8bb18e439cb.zip argaze-ecfbc519e518948078b0831ccd0fa8bb18e439cb.tar.gz argaze-ecfbc519e518948078b0831ccd0fa8bb18e439cb.tar.bz2 argaze-ecfbc519e518948078b0831ccd0fa8bb18e439cb.tar.xz |
Removing parsing of normals for ArUcoMarkersGroup.
Diffstat (limited to 'src')
-rw-r--r-- | src/argaze/ArUcoMarkers/ArUcoMarkersGroup.py | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/src/argaze/ArUcoMarkers/ArUcoMarkersGroup.py b/src/argaze/ArUcoMarkers/ArUcoMarkersGroup.py index b4aedbd..5cacf09 100644 --- a/src/argaze/ArUcoMarkers/ArUcoMarkersGroup.py +++ b/src/argaze/ArUcoMarkers/ArUcoMarkersGroup.py @@ -152,9 +152,6 @@ class ArUcoMarkersGroup(): !!! note All markers have to belong to the same dictionary. - !!! note - Marker normal vectors (vn) expected. - """ new_marker_size = 0 @@ -165,8 +162,7 @@ class ArUcoMarkersGroup(): OBJ_RX_DICT = { 'object': re.compile(r'o (.*)#([0-9]+)_(.*)\n'), 'vertice': re.compile(r'v ([+-]?[0-9]*[.]?[0-9]+) ([+-]?[0-9]*[.]?[0-9]+) ([+-]?[0-9]*[.]?[0-9]+)\n'), - 'normal': re.compile(r'vn ([+-]?[0-9]*[.]?[0-9]+) ([+-]?[0-9]*[.]?[0-9]+) ([+-]?[0-9]*[.]?[0-9]+)\n'), - 'face': re.compile(r'f ([0-9]+)//([0-9]+) ([0-9]+)//([0-9]+) ([0-9]+)//([0-9]+) ([0-9]+)//([0-9]+)\n'), + 'face': re.compile(r'f ([0-9]+) ([0-9]+) ([0-9]+) ([0-9]+)\n'), 'comment': re.compile(r'#(.*)\n') # keep comment regex after object regex because the # is used in object string too } @@ -186,7 +182,6 @@ class ArUcoMarkersGroup(): identifier = None vertices = [] - normals = {} faces = {} # Open the file and read through it line by line @@ -225,15 +220,10 @@ class ArUcoMarkersGroup(): vertices.append(tuple([float(match.group(1)), float(match.group(2)), float(match.group(3))])) - # Extract normal to calculate rotation matrix - elif key == 'normal': - - normals[identifier] = tuple([float(match.group(1)), float(match.group(2)), float(match.group(3))]) - # Extract vertice ids elif key == 'face': - faces[identifier] = [int(match.group(1)), int(match.group(3)), int(match.group(5)), int(match.group(7))] + faces[identifier] = [int(match.group(1)), int(match.group(2)), int(match.group(3)), int(match.group(4))] # Go to next line line = file.readline() @@ -487,10 +477,5 @@ class ArUcoMarkersGroup(): vertices += f' {v_count}//{p+1}' - # Write normal vector - nvec = numpy.cross(place.corners[-1] - place.corners[0], place.corners[1] - place.corners[0]) - nvec = nvec / numpy.linalg.norm(nvec) - file.write(f'vn {nvec[0]} {nvec[1]} {nvec[2]}\n') - #file.write('s off\n') file.write(f'f{vertices}\n') |