Forum

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - drewjgray

Pages: [1]
1
Feature Requests / Re: Import Scalebars between Markers
« on: December 23, 2023, 12:15:45 AM »
Hey ser1993, you can do this quite easily with the python api if you are familiar with it. Here is an example. I auto-detect 3 circular 12bit markers which are each 1 meter apart. Once the markers are detected you can use the python api to automatically create scale bars. Here is my code below:

Code: [Select]
def create_scale_bars(self):
        print('Creating scale bars...')
        marker1, marker2, marker3 = None, None, None
        for marker in self.chunk.markers:
            if marker.label == 'target 1':
                marker1 = marker
            elif marker.label == 'target 2':
                marker2 = marker
            elif marker.label == 'target 3':
                marker3 = marker

        distance = 1.0
        if marker1 and marker2 and marker3:
            scale_bar1 = self.chunk.addScalebar(marker1, marker2)
            scale_bar1.reference.distance = distance
            print(f'Scale bar of {distance}m added between "target 1" and "target 2"')
            scale_bar2 = self.chunk.addScalebar(marker1, marker3)
            scale_bar2.reference.distance = distance
            print(f'Scale bar of {distance}m added between "target 1" and "target 2"')
        else:
            print("Markers not found")
       
        self.doc.save()

2
General / Update Marker locations after moving/rotating model
« on: December 21, 2023, 11:32:26 PM »
How can I update the Marker positions after moving or rotating the model? I place markers to create scale bars, update the transform to apply the scale, then move the object to be aligned with +Z axis. However, after I move the object the marker positions remain the same. Updating the transform does not update the marker positions. How can I update the marker positions to be aligned with the new object position? (visually they are in the correct location but the X,Y,Z values remain unchanged - this is important as I have Python code that uses these positions).

Thank you,

Pages: [1]