Skip to main content

No project description provided

Project description

PySlice

Basic requirements:

  1. Create a basic instruction set that lets users add and remove cubes/cubesets
  2. Save the users' design in a file
  3. Develop a slicer that converts the design file to G-code

Refer to the Project Overview for more detailed information.

Refer to the repository to view the code.

PySlice Installation and Setup (in WSL environment)

Run the following commands in a WSL terminal.

pip3 install PySlice_Tools

If on a Windows OS, ensure that X11 Server for Windows (VcXsrv) is installed and running. If installed but not running, run the XLaunch app from the start menu.

How to Run the App

pyslice

Features

Commands

A set of commands are provided to interact with the application. x, y, and z represents the coordinate and they must be of integer values.

0. Help Window

Creates a pop up of possible commands.

help

1. Add a Unit Cube

The x, y, z position must be specified and must be of type integer.

addcube x y z

For example, the below command will add a unit cube with default color at position (1,2,3). The color of the cube will be the default color if the user did not pick a different color.

addcube 1 2 3 

2. Delete a Unit Cube

The x, y, z position must be specified when deleting a cube. If there is not a cube at this position, a warning will be given.

del x y z

3. Add a Cube Set

The x, y, z position of the starting cube must be specified and must be of type integer. Dimensions sx, sy, sz are also integers that represent the dimensions of the cube set. The top corner cube diagonally opposite of the starting cube will have position x + sx, y + sy, z + sz.

addcubeset x y z sx sy sz

4. Delete a Cube Set

Requires the same arguments as addcubeset.

delcubeset x y z sx sy sz

5. Save model

Save the currently open file by passing in the filename (without the .slice extension) and optionally the path to the directory where the file is located.

save filename [path_to_directory]

For example, the first command below command will save file "testfile1.slice" to the current working directory. The second command will save testfile2.slice to a given directory.

save testfile1
save testfile2 d:\Users\my_name\Documents\Projects

6. Load

Loading a previously saved model with file extension .slice requires the path (relative or absolute) to the file. An optional second argument 'f' or 'false can be given to not clear the currently loaded model. This can be useful if you want to combine different models.

load pathtofile [f]

7. Clear

Will clear current model from the display.

clear

8. Add Model

Creates a copy of a model file at a specified position.

addmodel filename x y z

9. Subtract Model

Subtracts a designfile from the current design at a specified position. Could be used as a configurable eraser.

submodel filename x y z

10. Slice

Generates a .gcode file for the specified designfile. If a design file is not specified, a .gcode file is generated for the current design. The gcode file can be used to print the model on a 3D printer.

slice [filename]

11. Set Model Boundary

Set the boundary of your model to avoid accidentally adding cubes outside of the intended boundary. The boundary area will be highlighted once a boundary is set. All args should be of integer type.

setbound min_x min_y min_z max_x max_y max_z

12. Undo

Reverses the actions of the previous command. Undo can be called until all items from the undo stack have been popped.

undo

13. Redo

Reverses an undo command. Redo can be called until all items from the Redo stack have been popped. If a command that is not undo or redo is entered, then the Redo stack is also cleared.

redo

14. Flip

Flips the model vertically.

flip

15. Move

Moves the model along the x, y, and z axes by specified offsets.

move xoffset yoffset zoffset

16. Rotate

Performs 2D rotation on the XY plane by 90, 180, or 270 degrees (or negative) about a set point (default x=y=0).

rotate 
rotate -90
rotate 270 1 1

17. Add Support

Creates a support element at a specified position.

addsupport x y z

18. Slicer Properties

Sets properties of slicer variables.

slicerprop position x y
slicerprop speed 1000
slicerprop extrusion 0.5
slicerprop infill 1.0
slicerprop layerHeight 1.0

Set Cube Color

A color picker is added to make it easy for users to pick a color that they want to use. The default color is blue. The alpha value (transparency) can only be set on certain systems.


Cycle through Commands Using Up/Down Arrow key

When pressing up/down arrow key with the command input box selected, one can cycle through the past commands that were typed into it. The up key makes it go back to older commands and the down key makes it go forward to newer commands.


Use Tab to Autocomplete Commands

Pressing tab when typing a command will find the longest common prefix of possible commands based on what is currently typed.

For example, typing

add [tab press]

will result in "addcube".


Error Checking

All illegal inputs will cause the error to be displayed in a pop up window.


Toolbar

The toolbar allows you to modify the camera.The home button resets the view while the left and right arrows serve as undo and redo respectively. The save button will save a picture of the cubes as a png to a specified location.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PySlice_Tools-1.4.tar.gz (235.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

PySlice_Tools-1.4-py3-none-any.whl (683.5 kB view details)

Uploaded Python 3

File details

Details for the file PySlice_Tools-1.4.tar.gz.

File metadata

  • Download URL: PySlice_Tools-1.4.tar.gz
  • Upload date:
  • Size: 235.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.2

File hashes

Hashes for PySlice_Tools-1.4.tar.gz
Algorithm Hash digest
SHA256 bf29baf2e570b81cbf3575c1b52a87db8aa6413fc7b1ba7a1a3ea0d6341867c0
MD5 793ee6886d340e64926198216c8f8352
BLAKE2b-256 7ce2030c32910c9d33f24ee89c8a57ef5b0318eb7487451fc13311d12c0cf0c8

See more details on using hashes here.

File details

Details for the file PySlice_Tools-1.4-py3-none-any.whl.

File metadata

  • Download URL: PySlice_Tools-1.4-py3-none-any.whl
  • Upload date:
  • Size: 683.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.2

File hashes

Hashes for PySlice_Tools-1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5fad9cf5c94a39f45e5cc9c7e0a015a5f1788a99948c3884ef66e73d8e9a8841
MD5 14e3a3ddff9c61a760a3c40692e53d9f
BLAKE2b-256 6418cba3c38cb4cd912b23b02f1ef0ffb98eda7cf3f4ee4845a0fae77238a92d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page