HomeIoTMethods to convert CAD property to glTF to be used with AWS...

Methods to convert CAD property to glTF to be used with AWS IoT TwinMaker


Clients typically have present 3D CAD (Laptop-aided Design) property that they want to use with AWS IoT TwinMaker. CAD information are both proprietary codecs optimized to be used in proprietary purposes or interchange codecs designed for shifting CAD information from one software to a different. They don’t seem to be normally appropriate with realtime WebGL viewports like these utilized in AWS IoT TwinMaker, which helps the glTF format. Clients might want to convert their CAD property to the glTF format earlier than importing these property to AWS IoT TwinMaker.

On this submit, I’ll reveal a workflow for utilizing Pixyz Situation Processor to transform a CAD file within the STEP format to a realtime 3D file within the glTF format. Pixyz Situation Processor is an answer supplied by Pixyz that’s out there in AWS Market. It may be configured for a number of totally different situations. On this instance, I will likely be utilizing the GenericPolygonTarget situation. This situation makes use of the most typical settings for changing CAD property to realtime property to be used in recreation engines and WebGL views. It has choices for setting the specified polygon rely, figuring out if objects ought to be merged collectively, and figuring out if hidden objects ought to be deleted.

Overview of answer

On this walkthrough, you’ll setup Amazon Elastic Container Service (ECS) to run the Pixyz Situation Processor on a file saved in Amazon Easy Storage Service (Amazon S3).

You’ll create an Amazon S3 bucket and add your CAD file for conversion. Additionally, you will create and run an AWS Fargate Activity that makes use of the Pixyz Situation Composer container picture to transform the CAD file to glTF. After working the duty, you’ll obtain the ensuing file from Amazon S3 to examine it in a glTF appropriate viewer.

Walkthrough

On this walkthrough I’ll reveal the creation of an AWS Fargate Activity that can seize a CAD file from an S3 bucket, convert it to a GLB (binary glTF format) file and retailer it again in that S3 bucket. The Fargate Activity will use the Pixyz Situation Processor from the AWS Market. This requires adjusting the default IAM coverage for working duties on Amazon ECS to permit for metering utilization of the AWS Market answer.

We’ll run by means of the next steps:

  1. Add the supply information to an S3 Bucket
  2. Create an IAM Position for working Amazon ECS Duties with the Pixyz Situation Processor
  3. Create the Community Solely Cluster
  4. Create the Activity Definition
  5. Run the Fargate Activity
  6. Look at the Logs
  7. (Optionally available) Obtain the glTF file and look at it

Stipulations

For this walkthrough, the next are stipulations:

  • An AWS account
  • Amazon S3 to retailer your CAD file
  • AWS IAM
  • Amazon ECS and AWS Fargate
  • A subscription to Pixyz Situation Processor on AWS Market.
    • For this instance, you can be charged for utilizing Pixyz Situation Processor with utilization primarily based pricing. Present pricing data is out there on the AWS Market product web page for Pixyz Situation Processor. Estimated price of finishing this train is $0.25 – $1.00.
  • A CAD file to transform. I will likely be utilizing the file, Waste_Container.step, however you need to use your personal visible property.
Image of the asset Waste_Container.step, a large green metal waste container.

Rendering of Waste_Container.step

Step 1: Add the supply information to an S3 Bucket

  1. Navigate to the Amazon S3 Console.
  2. Create a brand new bucket to make use of. I will likely be utilizing the us-west-2 area for this instance.
    My bucket title is: pixyz-example-20211117.
  3. Create an enter and an output folder contained in the bucket.
  4. Add the CAD file you need to convert into the enter folder.
    I’m utilizing a STEP file: Waste_Container.step.
Screenshot of AWS S3 Console page

Waste_Container.step uploaded to Amazon S3

Step 2: Create an IAM Position for working Amazon ECS Duties with the Pixyz Situation Processor

  1. Navigate to the AWS IAM Console Web page.
  2. Select the Roles part and press the Create Position button.
  3. Choose Elastic Container Service, then Elastic Container Service Activity, then choose the Subsequent:Permissions button.
  4. Connect the next Permissions:
    1. AWSMarketplaceMeteringRegisterUsage (permits AWS Market to Meter utilization)
    2. AmazonS3FullAccess (permits Amazon ECS to entry the S3 bucket)
    3. AmazonECSTaskExecutionPolicy (permits Amazon ECS to execute Duties)
  5. Choose the Subsequent:Tags button.
  6. Choose the Subsequent:Assessment button.
  7. Identify the position, I used pixyz-example-role-20211117.
  8. Add an outline, I used “Position created for Pixyz Situation Processor instance.” Choose the Create position button.

You need to now have a job that appears just like:

Screenshot of the AWS IAM Console

Permissions insurance policies utilized to IAM Position pixyz-example-role-20211117

Step 3: Create the Community Solely Cluster

  1. Navigate to the Amazon ECS console.
  2. Navigate to the Clusters part and choose the button to Create Cluster.
  3. Choose Networking Solely after which the Subsequent step button.
  4. Configure the Cluster with:
    1. title: pixyz-example-cluster
    2. Allow Create a brand new VPC for this cluster.
    3. Use default CIDR and subnet blocks.
    4. Allow Cloudwatch Container Insights.
  5. Choose the Create button.

Step 4: Create the Activity Definition

  1. Navigate to the Amazon ECS console.
  2. Navigate to the Activity Definition part and choose the button to Create new Activity Definition.
  3. Select the Fargate choice and choose the Subsequent step button.
  4. Configure the Activity:
    1. Give it a reputation, I used: pixyz-example-task
    2. For Activity position, use the IAM position you created above: pixyz-example-role-20211117
    3. Working system household: Linux.
    4. For Activity Execution position, once more, use the IAM position you created: pixyz-example-role-20211117
    5. Activity Reminiscence: 4 GB
    6. Activity CPU (vCPU): 1 vCPU
    7. Create a container with the Add container button and configure with:
      1. title: pixyz-example-container
      2. picture url: 709825985650.dkr.ecr.us-east-1.amazonaws.com/pixyz-software/scenario-processor:2021.1.0.79
      3. take away port-mappings
      4. Atmosphere Command:
        GenericPolygonTarget,s3File_with_arguments,"pixyz-example-20211117","us-west-2","enter/Waste_Container.step",False,"pixyz-example-20211117","us-west-2","output/Waste_Container.glb",10000,False,False,False

        The command template supplied within the Pixyz Situation Processor Fast-Begin is:

        GenericPolygonTarget,s3File_with_arguments,"my-input-bucket-name", "my-input-bucket-region", "enter/inputFile.step",False,"my-output-bucket-name","my-output-bucket-region","outputFolder/resultFile.xxx",10000,False,False,False

        In our model we’ve changed:
        my-input-bucket-name with pixyz-example-20211117
        my-input-bucket-region with us-west-2
        enter/inputFile.step with enter/Waste_Container.step
        my-output-bucket-name with pixyz-example-20211117
        my-output-bucket-region with us-west-2
        outputFolder/resultFile.xxx with output/Waste_Container.glb

Step 5: Run the Fargate Activity

  1. Navigate to the Amazon ECS console.
  2. Navigate to the Activity Definition part.
  3. Choose the Activity Definition and from the Actions button choose Run Activity.
  4. Configure the Run Activity with:
    1. Launch Sort: Fargate
    2. Working System Household: Linux
    3. Cluster: pixyz-example-cluster
    4. Add the each of the out there Subnets to the Cluster VPC.
  5. Press the Run Activity button to run the duty.

Step 6: Look at the Logs

You should use the Amazon CloudWatch Console to observe the Fargate activity in progress. Because the Pixyz Situation Processor runs it outputs logs to a CloudWatch Log Group.

  1. Navigate to the Amazon CloudWatch Console.
  2. Navigate to the Log Teams part and select the ecs/pixzy-example-task log group.
  3. Choose the Log Stream that can look just like ecs/pixyz-example-container
  4. Learn by means of the logs generated by the duty.

Frequent errors are:

  1. Register error: AccessDenied Exception. The IAM position used doesn’t have the suitable insurance policies. The duty is utilizing an autogenerated ecsTaskExecutionRole as an alternative of the IAM position we created above. You’ll must replace the Activity Definition with the right position.
  2. Bucket Not Discovered. There’s a typo within the Atmosphere Command the place the buckets and information outlined within the command string don’t exist. You’ll must replace the Activity Definition with the right bucket names an enter and output folder/filenames.

Step 7: (Optionally available) Obtain the glTF file and look at it

  1. Navigate to the Amazon S3 Console.
  2. Navigate to the bucket pixyz-example-20211117 and folder output.
  3. Choose the file generated by the duty, for me that is Waste_Container.glb, and press the Obtain button.

To view glTF and GLB information on my native pc, I exploit Visible Studio Code with the glTF Instruments extension.

Screenshot of Waste_Container.glb viewed in Visual Studio Code

Waste_Container.glb rendered in Visible Studio Code.

Cleansing up

To keep away from incurring ongoing storage expenses for objects in Amazon S3 or logs in Amazon CloudWatch, you must delete the assets created on this walkthrough. You also needs to take away the IAM position, AWS Fargate Activity Definition and Cluster. Lastly, unsubscribe from the Pixyz Situation Processor to complete cleansing up from this walkthrough.

Take away the S3 bucket, folders, and information

  1. Navigate to the Amazon S3 Console and the bucket, pixyz-example-20211117.
  2. Delete the S3 objects enter/Waste_Container.step and output/WasteContainer.glb.
  3. Delete the folders enter and output.
  4. Delete the S3 bucket, pixyz-example-20211117.

Take away the IAM position

  1. Navigate to the AWS IAM Console.
  2. Select the Roles part and delete pixyz-example-role-20211117.

Take away the AWS Fargate Activity Definition and Cluster

  1. Navigate to the Amazon ECS console.
  2. Within the Activity Definitions part, use the Actions button to de-register the Activity, pixyz-example-task.
  3. Within the Clusters part, use the Delete Cluster button to delete your cluster, pixyz-example-cluster.

Take away the Logs from Amazon CloudWatch

  1. Navigate to the Amazon CloudWatch Console.
  2. Within the Log Teams part, use the Actions button to Delete log group(s), ecs/pixzy-example-task.

Unsubscribe from the Pixyz Situation Processor subscription

  1. Navigate to the AWS Market Console.
  2. Choose the Pixyz Situation Processor and use the Actions button to Cancel subscriptions.

Conclusion

On this walkthrough you used the Pixyz Situation Processor to transform a CAD asset to a glTF file that is able to use with AWS IoT TwinMaker. You possibly can modify the AWS Fargate Activity to transform every other CAD information you want to use with AWS IoT TwinMaker.

Now that you’ve a glTF asset, you need to use it with AWS IoT TwinMaker to create digital twins of real-world techniques to optimize operations.

In regards to the creator

Jeremiah Habets is a Sr. Spatial Advisor with Amazon Net Providers (AWS) Skilled Providers. Jeremiah helps prospects clear up issues in AR/VR, Simulation, Visualizations utilizing realtime 3D expertise.

 

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments