-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement new 'pipeline' command structure
- Loading branch information
Showing
11 changed files
with
695 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,65 @@ | ||
# uv3dp | ||
Tools for UV Resin based 3D Printers (in Go) | ||
|
||
## Supported File Formats | ||
|
||
This tool is for devices that use the Prusa SL1 (`*.sla`) and ChiTuBox DLP (`*.cbddlp`) format files. | ||
|
||
Printers known to work with this tool: | ||
|
||
| Printer | File Formats | Issues | | ||
| ------------ | ------------ | --------------------------------------------------| | ||
| EPAX X-1 | cbddlp | None | | ||
|
||
## Command Line Tool (`uv3dp`) | ||
|
||
The command line tool (available as a binary release at | ||
[https://github.com/ezrec/uv3dp/releases](github.com/ezrec/uv3dp) ) 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 # Converts and decimates a SL1 files to a CBDDLP file | ||
uv3dp foo.sl1 qux.cbddlp --version 1 # Converts a SL1 files to a CBDDLP file, forcing verion 1 CBDDLP file format | ||
|
||
### Command summary: | ||
|
||
Usage: | ||
|
||
uv3dp [options] INFILE [command [options] | OUTFILE]... | ||
|
||
Options: | ||
|
||
-v, --verbose count Verbosity | ||
|
||
Commands: | ||
|
||
(none) Translates input file to output file | ||
info Dumps information about the printable | ||
decimate Remove outmost pixels of all islands in each layer (reduces over-curing on edges) | ||
exposure Alters exposure times | ||
|
||
Options for 'info': | ||
|
||
-e, --exposure Show summary of the exposure settings (default true) | ||
-l, --layers Show summary of the layers (default true) | ||
|
||
Options for 'decimate': | ||
|
||
|
||
Options for 'exposure': | ||
|
||
--bottom-count uint Bottom layer count | ||
--bottom-exposure duration Bottom layer light-on time | ||
--exposure duration Normal layer light-on time | ||
|
||
Options for '*.cbddlp': | ||
|
||
--version uint32 Override header Version (default 2) | ||
|
||
Options for '*.photon': | ||
|
||
--version uint32 Override header Version (default 1) | ||
|
||
Options for '*.sl1': | ||
|
||
-m, --material-name string config.init entry 'materialName' (default "3DM-ABS @") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// Copyright (c) 2020 Jason S. McMullan <jason.mcmullan@gmail.com> | ||
// | ||
|
||
package main | ||
|
||
import ( | ||
"github.com/spf13/pflag" | ||
|
||
"github.com/ezrec/uv3dp" | ||
) | ||
|
||
type DecimateCommand struct { | ||
*pflag.FlagSet | ||
} | ||
|
||
func NewDecimateCommand() (info *DecimateCommand) { | ||
flagSet := pflag.NewFlagSet("info", pflag.ContinueOnError) | ||
flagSet.SetInterspersed(false) | ||
|
||
info = &DecimateCommand{ | ||
FlagSet: flagSet, | ||
} | ||
|
||
return | ||
} | ||
|
||
func (info *DecimateCommand) Filter(input uv3dp.Printable) (output uv3dp.Printable, err error) { | ||
output = uv3dp.NewDecimatedPrintable(input) | ||
|
||
return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
// | ||
// Copyright (c) 2020 Jason S. McMullan <jason.mcmullan@gmail.com> | ||
// | ||
|
||
package main | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/spf13/pflag" | ||
|
||
"github.com/ezrec/uv3dp" | ||
) | ||
|
||
type ExposureCommand struct { | ||
*pflag.FlagSet | ||
|
||
Exposure time.Duration // Time to expose a normal layer | ||
|
||
BottomCount uint // Number of bottom layers | ||
BottomExposure time.Duration | ||
} | ||
|
||
func NewExposureCommand() (ec *ExposureCommand) { | ||
ec = &ExposureCommand{ | ||
FlagSet: pflag.NewFlagSet("exposure", pflag.ContinueOnError), | ||
} | ||
|
||
ec.DurationVar(&ec.Exposure, "exposure", time.Duration(0), "Normal layer light-on time") | ||
ec.UintVar(&ec.BottomCount, "bottom-count", 0, "Bottom layer count") | ||
ec.DurationVar(&ec.BottomExposure, "bottom-exposure", time.Duration(0), "Bottom layer light-on time") | ||
ec.SetInterspersed(false) | ||
|
||
return | ||
} | ||
|
||
type exposureModifier struct { | ||
uv3dp.Printable | ||
properties uv3dp.Properties | ||
} | ||
|
||
func (em *exposureModifier) Properties() (prop uv3dp.Properties) { | ||
prop = em.properties | ||
return | ||
} | ||
|
||
func (em *exposureModifier) Layer(index int) (layer uv3dp.Layer) { | ||
layer = em.Printable.Layer(index) | ||
|
||
exp := &em.properties.Exposure | ||
bot := &em.properties.Bottom.Exposure | ||
bottomCount := em.properties.Bottom.Count | ||
|
||
if index < bottomCount { | ||
layer.Exposure = bot | ||
} else { | ||
layer.Exposure = exp | ||
} | ||
|
||
return | ||
} | ||
|
||
func (ec *ExposureCommand) Filter(input uv3dp.Printable) (output uv3dp.Printable, err error) { | ||
em := &exposureModifier{ | ||
Printable: input, | ||
properties: input.Properties(), | ||
} | ||
|
||
if ec.Changed("exposure") { | ||
TraceVerbosef(VerbosityNotice, " Setting default exposure time to %v", ec.Exposure) | ||
em.properties.Exposure.LightExposure = ec.Exposure | ||
} | ||
|
||
if ec.Changed("bottom-count") { | ||
TraceVerbosef(VerbosityNotice, " Setting default bottom layer count %v", ec.BottomCount) | ||
em.properties.Bottom.Count = int(ec.BottomCount) | ||
} | ||
|
||
if ec.Changed("bottom-exposure") { | ||
TraceVerbosef(VerbosityNotice, " Setting default bottom time to %v", ec.BottomExposure) | ||
em.properties.Bottom.Exposure.LightExposure = ec.BottomExposure | ||
} | ||
|
||
output = em | ||
|
||
return | ||
} |
Oops, something went wrong.