/ galaxy-csg Public

## History

91 lines (63 loc) · 5.83 KB

## File metadata and controls

91 lines (63 loc) · 5.83 KB

# Galaxy tools for Constructive Solid Geometry (Galaxy CSG flavor)

This repository contains tools that can be used within Galaxy for creating, assembling and solving equations on 3-dimensional shapes. Galaxy includes a CSG Viewer Visualization plug-in for viewing the shapes produced by these tools. The CSG Viewer plug-in is available here in the Galaxy code.

These tools are written in Python and use the following packages.

All of these tools are available in the Galaxy Tool Shed, so they can be automatically installed into Galaxy.

The docker container for the Galaxy CSG flavor is available here

## Tool Highlights

• Create 3D shape - Creates a selected primitive shape where shapes are Box, Cone, Cylinder and Sphere.
• Compose 3D shapes - Creates a shape composed of any number of selected shapes where the composition is based on a mathematical expression consisting of +, - and * operations. The + results in a union of shapes, the - operator removes a shape and the * operator results in an intersection of shapes.
• Scale shape - Magnifies the dimensions of a shape along some specified axes.
• Translate shape - Applies translation operations to a shape by adding a displacement to each coordinate.
• Rotate shape - Applies a rotation to a shape by a given angle about an arbitrary axis.
• Refine shape - Refines the discrete, triangulated surface representation of a shape using a maximum edge length criterion, breaking triangles into smaller ones where necessary.
• Coarsen shape - Coarsens the discrete, triangulated surface representation of a shape using a minimum cell area criterion, merging triangles into larger ones where necessary.
• Add texture - Adds a texture to a shape by projecting an image onto the surface of the shape.
• Add surface field - Adds a surface field to a selected shape based on a given mathematical expression consisting of variables x, y, z (shape point coordinates) and t (time).
• Color surface field - Colors a shape's surface field using a selected color map.
• Solve Laplace equation - Solve the Laplace equation given prescribed Dirichlet boundary conditions applied as a surface field. The resulting field corresponds to the electric field in an electrostatic problem.

## Creating shapes

This is the Create 3D shape tool. It allows you to create 4 primitive shapes, boxes, cones, cylinders and spheres. Here we're creating a cylinder.

We can view and manipulate the cylinder using the Galaxy CSG Viewer plug-in.

The plug-in renders the 3D image in Galaxy.

We can create a cone...

...and a box.

The Create 3D shape tool allows you to create a shape by cloning another shape. Options include rotating or translating the cloned shape. Here we clone the box we just created, rotating it 90 degrees around the X axis.

## Composing shapes

This is the Compose shapes tool. This tool creates a shape composed of any number of selected shapes where the composition is based on a mathematical expression consisting of +, - and * operations. The + operator results in a union of shapes, the - operator removes a shape and the * operator results in an intersection of shapes. Here we are composing the four primitive shapes we just created, adding the cone to the cylinder and subtracting both boxes.

Our composed shapes produce a bolt.