Skip to content

tomMulholland/pyEng

Repository files navigation

pyEng

Scripts for some engineering problems

convective_cooling.py

Convective cooling of a cylinder in air crossflow

This script analyzes a hot, plastic cylinder being cooled by air at a certain velocity. The analytical equations are solved numerically (to avoid direct solution with an equation solver package). The equations were taken from Icropera, DeWitt, Bergman, and Lavine's textbook Fundamentals of Heat and Mass Transfer Output is a graph of the cooling curves through the cylinder at the center and 1/10, 2/10...10/10 of the radius.

coordinate_transform.py

Rotate a coordinate system

This script was created to solve a problem in an injection molding simulation software. Local coordinate systems are defined in terms of the global system, and the local system needed to be rotated by some angle. The input are points which define the local origin, a point on the local x-axis, and a point on the local x-y plane. The output are these same points, rotated with respect to the local coordinate system, defined in the global coordinates.

stiffness_matrix.py

Orthotropic stiffness matrix and basic stress-strain calculation

This script helps the user define the 6x6 stiffness matrix of an orthotropic material. It also includes an example of the basic stress-strain calculation.

min_seg_octave.m

Script to eliminate very short segments from Gcode files, which cause problems for some firmware

This script was written to deal with Gcode generated by Simplify3D, which tends to have many very small segments/movements. These extremely short movements can cause issues with some firmware and printers, in my case, with a MakerGear M2. The script will read the file and copy to a new file, ignoring movements that are shorter than the l_min variable.

For one 12-hour print, the original Gcode was around 50 Mb, and the script reduced the output file by more than 20%.

gcode_adjuster_3extruders.py

Script to reorganize Gcode generated with virtual extruders to more precisely control toolpath.

For FFF printing of a complex part that required very thin walls and watertightness, it was necessary to precisely control the toolpath in certain sections. The part was divided into several STL files, which were combined in Slic3r. Each STL could have a separate set of slicing parameters if each STL was printed by a different extruder, in this case, virtual extruders. Deleting the tool change commands allows this Gcode to run as is. However, slicers try to minimize tool changes, so each layer begins with a different virtual extruder. In order for every layer to start with Extruder 1, then Extruder 2, etc., it was necessary to reorganize the Gcode. This script does that, then checks for (and fixes) errors concerning retractions.

About

scripts for some engineering problems

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published