Package: amaz3dpy
Introductionamaz3dpy is a Python SDK to interact with Amaz3d Web APIs.
This SDK is built by three main component:Object primitives for dealing with Authentication, Projects and OptimizationsA simple Client that simplifies interaction with Web APIs providing authentication, projects handling (visualization, creation, etc.), optimizations handling (creation and download)A cli command for using Amaz3D from a terminal sessionPlease consider that an Amaz3d account is required for using all functionalitiesFor further information visit:Adapta Studio WebsiteObject primitivesamaz3dpy provides primitives for interacting with Amaz3d functionalities.
Here you can find the import statements for the main objects:fromamaz3dpy.authimportAuthfromamaz3dpy.projectsimportProjectsfromamaz3dpy.modelsimportLoginInput,Optimization,OptimizationNormalBakingParamsInput,OptimizationOutputFormat,OptimizationParams,OptimizationPreset,Projectfromamaz3dpy.optimizationsimportProjectOptimizationsfromamaz3dpy.customer_walletimportCustomerWalletfromamaz3dpy.optimization_templatesimportOptimizationTemplatesfromamaz3dpy.termsimportTermsClientThe client encapsulates object primitives to follow the application business logic:fromamaz3dpy.clientsimportAmaz3DClientfromamaz3dpy.modelsimportOptimizationOutputFormat,OptimizationParams,OptimizationPresetamaz3dclient=Amaz3DClient()amaz3dclient.login(email="your@email.com",password="mypass")my_project={"name":"My project","file_path":"/path/to/file"}amaz3dclient.create_project(**my_project)amaz3dclient.load_projects()print(amaz3dclient.projects()amaz3dclient.select_a_project(id="....id.....")amaz3dclient.load_optimizations()print(amaz3dclient.optimizations())format=OptimizationOutputFormat['format_orig']params=OptimizationParams()params.face_reduction=0.5params.feature_importance=0params.preserve_hard_edges=False....optimization=amaz3dclient.create_optimization("my optimization",format,params=params)amaz3dclient.select_an_optimization(id=".....id......")amaz3dclient.download_selected_optimization(dst_path="/my/path")CliIt is possible to run a simple interactive CLI application for creating projects and optimizations.
Open your terminal and run:amaz3dLoginRun thelogincommand, and insert your credentialsProjects managementIt is possible to load and view projects by runningload_projectsandprojectsThe first command loads projects page by page.The second command instead prints all projects loaded.create_projectis used to create a new project and to upload an object that could be optimized afterwardsOptimizations managementBefore creating or visualizing optimization it is necessary to select a project withselect_projectcommand.Optimization visualization follows the same logic of projects: useload_optimizationsandoptimizationscommandscreate_optimizationis used to create an optimization for the selected project. It is possible to create optimization by selecting a preset or by tweaking advanced parametersDownlaod an optimizationTo download an optimization it is necessary to select it first using theselect_optimizationcommand.
After that an optimization is selected it is possible to download the result with thedownload_selected_optimizationcommand.HelpType help to get a list of available commands