uv3dp

package module
v0.8.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2020 License: MIT Imports: 8 Imported by: 12

README

uv3dp

Tools for UV Resin based 3D Printers (in Go)

Supported File Formats

This tool is for devices that use sliced image files for UV resin 3D printers.

Printers known to work with this tool:

Printer File Formats Issues
- uvj Zip file with JSON and image slices
EPAX X1/X10 cbddlp None
EPAX X1-N ctb None
Anycubic Photon photon None
} Anycubic Zero pw0 Untested
} Anycubic Photons pws Untested
Prusa SL1 sl1 None
NOVA3D Elfin cws Untested
Phrozen Sonic phz None
Zortrax Inkspire zcodex Read-only (for format conversion)

Installation

Command Line Tool (uv3dp)

The command line tool is designed to be used in a 'pipeline' style, for example:

uv3dp foo.sl1 info                    # Shows information about the SL1 file
uv3dp foo.sl1 decimate bar.cbddlp     # Convert and decimates a SL1 file to a CBDDLP file
uv3dp foo.sl1 qux.cbddlp --version 1  # Convert a SL1 file to a Version 1CBDDLP file
Command summary:
Usage:

  uv3dp [options] INFILE [command [options] | OUTFILE]...
  uv3dp [options] @cmdfile.cmd

Options:

  -p, --progress        Show progress during operations
  -v, --verbose count   Verbosity
  -V, --version         Show version

Commands:

  (none)               Translates input file to output file
  bed                  Adjust image for a different bed size/resolution
  bottom               Alters bottom layer exposure
  decimate             Remove outmost pixels of all islands in each layer (reduces over-curing on edges)
  exposure             Alters exposure times
  info                 Dumps information about the printable
  lift                 Alters layer lift properties
  resin                Changes all properties to match a selected resin
  retract              Alters layer retract properties
  select               Select to print only a range of layers

Options for 'bed':

  -M, --machine string             Size preset by machine type (default "EPAX-X1")
  -m, --millimeters float32Slice   Bed size, in millimeters (default [68.040001,120.959999])
  -p, --pixels ints                Bed size, in pixels (default [1440,2560])
  -r, --reflect                    Mirror image along the X axis

Options for 'bottom':

  -c, --count int             Bottom layer count
  -h, --lift-height float32   Bottom layer lift height in mm
  -s, --lift-speed float32    Bottom layer lift speed in mm/min
  -f, --light-off float32     Bottom layer light-off time in seconds
  -o, --light-on float32      Bottom layer light-on time in seconds
  -p, --pwm uint8             Light PWM rate (0..255) (default 255)
  -y, --style string          Bottom layer style - 'fade' or 'slow' (default "slow")

Options for 'decimate':

  -b, --bottom       Decimate bottom layers only
  -n, --normal       Decimate normal layers only
  -p, --passes int   Number of decimation passes (default 1)

Options for 'exposure':

  -f, --light-off float32   Normal layer light-off time in seconds
  -o, --light-on float32    Normal layer light-on time in seconds
  -p, --pwm uint8           Light PWM rate (0..255) (default 255)

Options for 'info':

  -e, --exposure   Show summary of the exposure settings (default true)
  -l, --layer      Show layer detail
  -s, --size       Show size summary (default true)

Options for 'lift':

  -h, --height float32   Lift height in mm
  -s, --speed float32    Lift speed in mm/min

Options for 'resin':

  -t, --type string   Resin type [see 'Known resins' in help]

Options for 'retract':

  -h, --height float32   Retract height in mm
  -s, --speed float32    Retract speed in mm/min

Options for 'select':

  -c, --count int   Count of layers to select (-1 for all layers after first) (default -1)
  -f, --first int   First layer to select

Options for '.cbddlp':

  -a, --anti-alias int   Override antialias level (1,2,4,8) (default 1)
  -v, --version int      Override header Version (default 2)

Options for '.ctb':

  -e, --encryption-seed uint32   Specify a specific encryption seed

Options for '.cws':


Options for '.photon':

  -a, --anti-alias int   Override antialias level (1,2,4,8) (default 1)
  -v, --version int      Override header Version (default 1)

Options for '.phz':

  -e, --encryption-seed uint32   Specify a specific encryption seed

Options for '.pw0':

  -a, --anti-alias int   Override antialias level (1,2,4,8) (default 1)

Options for '.pws':

  -a, --anti-alias int   Override antialias level (1,2,4,8) (default 1)

Options for '.sl1':

  -m, --material-name string   config.init entry 'materialName' (default "3DM-ABS @")

Options for '.uvj':


Options for '.zcodex':


Options for 'empty':

  -M, --machine string             Size preset by machine type (default "EPAX-X1")
  -m, --millimeters float32Slice   Empty size, in millimeters (default [68.040001,120.959999])
  -p, --pixels ints                Empty size, in pixels (default [1440,2560])

Known machines:

    Anycubic-Photon      1440x2560, 68x121 mm
    Anycubic-Photon-S    1440x2560, 68x121 mm
    Anycubic-Photon-Zero 480x854, 55.4x98.6 mm
    EPAX-X1              1440x2560, 68x121 mm
    EPAX-X10             1600x2560, 135x216 mm
    EPAX-X133            2160x3840, 165x293 mm
    EPAX-X156            2160x3840, 194x345 mm
    EPAX-X9              1600x2560, 120x192 mm
    Elogoo-Mars          1440x2560, 68x121 mm
    Kelant-S400          2560x1600, 192x120 mm
    Nova3D-Elfin         1410x2550, 73x132 mm
    Phrozen-Sonic-Mini   1080x1920, 68x121 mm
    Zortrax-Inkspire     1440x2560, 72x128 mm

Known resins: (from local user ChiTuBox config)

Documentation

Overview

Package uv3dp is a set of tools for data exchange between UV Resin based 3D printers

Index

Constants

View Source
const (
	BottomStyleSlow = BottomStyle(iota) // Abruptly transition from slow to normal exposure
	BottomStyleFade                     // Gradually transition for slow to normal layers
)
View Source
const (
	PreviewTypeTiny = PreviewType(iota)
	PreviewTypeHuge
)

Variables

This section is empty.

Functions

func FormatterUsage added in v0.2.0

func FormatterUsage()

func RegisterFormatter added in v0.2.0

func RegisterFormatter(suffix string, newFormatter NewFormatter)

func SetProgress added in v0.7.3

func SetProgress(prog Progressor)

func WithAllLayers added in v0.6.1

func WithAllLayers(p Printable, do func(n int, layer Layer))

WithAllLayers executes a function in parallel over all of the layers

func WithEachLayer added in v0.7.5

func WithEachLayer(p Printable, do func(n int, layer Layer))

WithEachLayer executes a function in over all of the layers, serially (but possibly out of order)

Types

type Bottom

type Bottom struct {
	Exposure             // Exposure
	Count    int         // Number of bottom layers
	Style    BottomStyle // Transition style
}

Bottom layer exposure

type BottomStyle added in v0.2.3

type BottomStyle int

Bottom layer style

func (BottomStyle) String added in v0.2.6

func (bs BottomStyle) String() string

type DecimatedPrintable

type DecimatedPrintable struct {
	Printable
	Passes     int // Number of passes of decimation
	FirstLayer int // First layer to start decimating
	Layers     int // Count of layers to decimate
}

func NewDecimatedPrintable

func NewDecimatedPrintable(printable Printable) (dp *DecimatedPrintable)

func (*DecimatedPrintable) Layer

func (dec *DecimatedPrintable) Layer(index int) (layer Layer)

type EmptyPrintable added in v0.2.2

type EmptyPrintable struct {
	// contains filtered or unexported fields
}

func NewEmptyPrintable added in v0.2.2

func NewEmptyPrintable(prop Properties) (empty *EmptyPrintable)

func (*EmptyPrintable) Layer added in v0.2.2

func (empty *EmptyPrintable) Layer(index int) (layer Layer)

func (*EmptyPrintable) Properties added in v0.2.2

func (empty *EmptyPrintable) Properties() (prop Properties)

type Exposure

type Exposure struct {
	LightOnTime   float32 // Exposure time
	LightOffTime  float32 // Cool down time
	LightPWM      uint8   // PWM from 1..255
	LiftHeight    float32 // mm
	LiftSpeed     float32 // mm/min
	RetractHeight float32 // mm
	RetractSpeed  float32 // mm/min
}

Per-layer exposure

func (*Exposure) Duration

func (exp *Exposure) Duration() (total float32)

Total duration of an exposure

func (*Exposure) Interpolate added in v0.2.3

func (exp *Exposure) Interpolate(target Exposure, scale float32) (result Exposure)

Interpolate scales settings between this and another Exposure

type Format added in v0.2.0

type Format struct {
	Formatter
	Suffix   string
	Filename string
}

func NewFormat added in v0.2.0

func NewFormat(filename string, args []string) (format *Format, err error)

func (*Format) Printable added in v0.2.0

func (format *Format) Printable() (printable Printable, err error)

func (*Format) SetPrintable added in v0.2.0

func (format *Format) SetPrintable(printable Printable) (err error)

Write writes a printable to the file format

type Formatter added in v0.2.0

type Formatter interface {
	Parse(args []string) (err error)
	Parsed() bool
	Args() (args []string)
	NArg() int
	PrintDefaults()

	Decode(reader Reader, size int64) (printable Printable, err error)
	Encode(writer Writer, printable Printable) (err error)
}

Printable file format

type Layer

type Layer struct {
	Z        float32     // Z height in mm
	Exposure Exposure    // Layer exposure settings
	Image    *image.Gray `json:",omitempty"` // Image mask
}

Everything needed to print a single layer

type NewFormatter added in v0.2.0

type NewFormatter func(suffix string) (formatter Formatter)

Printable to file format

type PreviewType

type PreviewType uint

type Printable

type Printable interface {
	Properties() (prop Properties)
	Layer(index int) (layer Layer)
}

type Progress added in v0.7.3

type Progress struct {
	Progressor
	Completed chan struct{}
	Done      chan struct{}
}

func NewProgress added in v0.7.3

func NewProgress(total int) (prog *Progress)

func (*Progress) Close added in v0.7.3

func (prog *Progress) Close()

func (*Progress) Indicate added in v0.7.3

func (prog *Progress) Indicate()

type Progressor added in v0.7.3

type Progressor interface {
	Show(percent float32)
	Stop()
}

type Properties

type Properties struct {
	Size     Size
	Exposure Exposure
	Bottom   Bottom
	Preview  map[PreviewType]image.Image `json:",omitempty"`
	Metadata map[string](interface{})    `json:",omitempty"`
}

func (*Properties) Bounds

func (prop *Properties) Bounds() image.Rectangle

Get image bounds

func (*Properties) Duration added in v0.2.0

func (prop *Properties) Duration() (duration float32)

Duration returns total printing time

func (*Properties) GetMetadataUint8 added in v0.8.4

func (prop *Properties) GetMetadataUint8(attr string, defValue uint8) (value uint8)

Get metadata

func (*Properties) LayerExposure added in v0.2.3

func (prop *Properties) LayerExposure(index int) (exposure Exposure)

LayerExposure gets the default exposure by layer index

type Reader added in v0.2.2

type Reader interface {
	io.Reader
	io.ReaderAt
}

Reader needs io.ReaderAt for archive/zip

type Size

type Size struct {
	X, Y        int            // Printable size in pixels (x,y)
	Millimeter  SizeMillimeter // Printable size in mm
	Layers      int
	LayerHeight float32 // Height of an individual layer
}

type SizeMillimeter

type SizeMillimeter struct {
	X, Y float32
}

type Writer added in v0.2.2

type Writer interface {
	io.Writer
}

Writer

Directories

Path Synopsis
Package cbddlp handle input and output of Chitubox DLP/LCD printables
Package cbddlp handle input and output of Chitubox DLP/LCD printables
cmd
Package ctb handle input and output of Chitubox DLP/LCD printables
Package ctb handle input and output of Chitubox DLP/LCD printables
Package cws handles input and output of NOVA32 CWS printables
Package cws handles input and output of NOVA32 CWS printables
Package ctb handle input and output of Chitubox DLP/LCD printables
Package ctb handle input and output of Chitubox DLP/LCD printables
Package pws handles input and output of Anycubic Photons 2.0 (.pws) printables
Package pws handles input and output of Anycubic Photons 2.0 (.pws) printables
Package sl1 handles input and output of Prusa SL1 DLP/LCD printables
Package sl1 handles input and output of Prusa SL1 DLP/LCD printables
Package uvj handles input and output of UV3DP 'generic' zip files (JSON slice description and images)
Package uvj handles input and output of UV3DP 'generic' zip files (JSON slice description and images)
Package zcodex handles input and output of Prusa SL1 DLP/LCD printables
Package zcodex handles input and output of Prusa SL1 DLP/LCD printables

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL