16
Feature Requests / Re: Center Rotation on Object
« on: December 01, 2023, 03:00:58 PM »
You can also double click to change the rotation center in the position you want.
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.
import Metashape
def main():
doc = Metashape.app.document
for i in range(len(doc.chunks)):
chunk = doc.chunks[i]
R = chunk.region.rot #Bounding box rotation matrix
C = chunk.region.center #Bounding box center vertor
size = chunk.region.size
if not (chunk.point_cloud and chunk.enabled):
continue
elif not len(chunk.point_cloud.points):
continue
for point in chunk.point_cloud.points:
if point.valid:
v = point.coord
v.size = 3
v_c = v - C
v_r = R.t() * v_c
if abs(v_r.x) > abs(size.x / 2.):
point.valid = False
elif abs(v_r.y) > abs(size.y / 2.):
point.valid = False
elif abs(v_r.z) > abs(size.z / 2.):
point.valid = False
else:
continue
print("Script finished. Points outside the region were removed.")
Metashape.app.addMenuItem("Scripts/Delete Points Outside Bounding Box", main)
So, as I'm running out of storage capacity quite fast, here they are my questions:
import PhotoScan
2021-12-01 16:36:25 Agisoft Photogrammetric Kit for TOPCON Version: 1.7.5 build 13229 (64 bit)
2021-12-01 16:36:25 Platform: Windows
2021-12-01 16:36:25 CPU: AMD Ryzen 7 2700X Eight-Core Processor (desktop)
2021-12-01 16:36:25 CPU family: 23 model: 8 signature: 800F82h
2021-12-01 16:36:25 RAM: 63.9 GB
2021-12-01 16:36:25 OpenGL Vendor: NVIDIA Corporation
2021-12-01 16:36:25 OpenGL Renderer: NVIDIA GeForce GTX 1070 Ti/PCIe/SSE2
2021-12-01 16:36:25 OpenGL Version: 4.6.0 NVIDIA 496.76
2021-12-01 16:36:25 Maximum Texture Size: 32768
2021-12-01 16:36:25 Quad Buffered Stereo: not enabled
2021-12-01 16:36:25 ARB_vertex_buffer_object: supported
2021-12-01 16:36:25 ARB_texture_non_power_of_two: supported
2021-12-01 16:36:25 To execute this script press Custom menu/Add reference altitude
2021-12-01 16:36:25 To execute this script press Custom menu/Align model or dense point cloud
2021-12-01 16:36:25 To execute this script press Custom menu/Color Model with Altitude
2021-12-01 16:36:25 To execute this script press Custom menu/Color Model with Overlap
2021-12-01 16:36:25 To execute this script press AI tools/Detect objects
2021-12-01 16:36:25 To execute this script press Custom menu/Masking by color
2021-12-01 16:36:25 To execute this script press Custom menu/Read RelativeAltitude from DJI metadata
2021-12-01 16:36:25 Warning: PhotoScan module is deprecated, use Metashape module instead
2021-12-01 16:36:33 imported auto_gamma_correction
2021-12-01 16:36:33 imported buffer_by_markers
2021-12-01 16:36:33 imported chunk_region_setter
2021-12-01 16:36:33 imported crs_uploader
2021-12-01 16:36:33 imported expimp_by_marker
2021-12-01 16:36:33 imported export_by_shapes
2021-12-01 16:36:33 imported fast_layout
2021-12-01 16:36:33 imported gnss_post_processing
2021-12-01 16:36:33 imported image_channel_mixer
2021-12-01 16:36:33 imported gnss_processing
2021-12-01 16:36:33 imported make_masks_from_shapes
2021-12-01 16:36:33 imported mesh_creator
2021-12-01 16:36:33 imported shape_worker
2021-12-01 16:36:33 imported plugins_configurator
2021-12-01 16:36:33 imported quality_estimator
2021-12-01 16:36:33 imported remove_image_duplicates
2021-12-01 16:36:33 imported set_altitudes_for_shape
2021-12-01 16:36:33 imported shape_worker
2021-12-01 16:36:33 imported tab_meta_creator
2021-12-01 16:36:33 To execute this script press Custom menu/Split in chunks