From eadd41415c344cf22a21db03a2dc336a3ef6d441 Mon Sep 17 00:00:00 2001 From: aligator Date: Fri, 2 Apr 2021 04:28:27 +0200 Subject: [PATCH] Fix module and package name to really be usable as lib --- README.md | 9 ++++----- clip/clip.go | 6 +++--- clip/linear.go | 2 +- cmd/goslice/main.go | 6 +++--- data/2d_test.go | 4 ++-- data/data_test.go | 4 ++-- data/layer_test.go | 4 ++-- data/micrometer_test.go | 4 ++-- data/option_test.go | 4 ++-- gcode/builder.go | 4 ++-- gcode/builder_test.go | 6 +++--- gcode/generator.go | 4 ++-- gcode/generator_test.go | 6 +++--- gcode/renderer/brim.go | 6 +++--- gcode/renderer/infill.go | 8 ++++---- gcode/renderer/layer.go | 4 ++-- gcode/renderer/perimeter.go | 6 +++--- gcode/renderer/skirt.go | 8 ++++---- go.mod | 2 +- goslice.go | 22 +++++++++++----------- goslice_test.go | 6 +++--- handler/handler.go | 2 +- modifier/brim.go | 6 +++--- modifier/infill.go | 6 +++--- modifier/internal_infill.go | 6 +++--- modifier/modifier.go | 2 +- modifier/perimeter.go | 6 +++--- modifier/support.go | 6 +++--- optimizer/face.go | 2 +- optimizer/model.go | 2 +- optimizer/optimizer.go | 4 ++-- optimizer/point.go | 2 +- reader/reader.go | 4 ++-- slicer/layer.go | 2 +- slicer/segment.go | 2 +- slicer/slicer.go | 6 +++--- writer/writer.go | 2 +- 37 files changed, 92 insertions(+), 93 deletions(-) diff --git a/README.md b/README.md index 76701ab..e30af22 100644 --- a/README.md +++ b/README.md @@ -96,11 +96,10 @@ Here some brief explanation of the interfaces. For more detailed information jus * Optimizer handler.ModelOptimizer Is responsible for - 1. checking the model - 2. optimizing it by e.g. removing doubles - 3. calculating some additional information, - like the touching vertices etc. which is needed for the next step. - The implementation of GoSlice is very currently basic and may have problems with some models. + 1. checking the model + 2. optimizing it by e.g. removing doubles + 3. calculating some additional information, like the touching vertices etc. which is needed for the next step. The + implementation of GoSlice is currently very basic and may have problems with some models. * Slicer handler.ModelSlicer Creates the slices (e.g. layers) out of the model. diff --git a/clip/clip.go b/clip/clip.go index 05658ea..30eaa9b 100644 --- a/clip/clip.go +++ b/clip/clip.go @@ -3,10 +3,10 @@ package clip import ( - "GoSlice/data" + "github.com/aligator/goslice/data" clipper "github.com/aligator/go.clipper" - go_convex_hull_2d "github.com/furstenheim/go-convex-hull-2d" + goconvexhull2d "github.com/furstenheim/go-convex-hull-2d" ) // Pattern is an interface for all infill types which can be used to fill layer parts. @@ -352,7 +352,7 @@ func (c clipperClipper) Hull(parts []data.LayerPart) (hull data.Path, ok bool) { allPoints = append(allPoints, part.Outline()...) } - convexHull := go_convex_hull_2d.New(allPoints) + convexHull := goconvexhull2d.New(allPoints) hullPath, ok := convexHull.(data.Path) if !ok { diff --git a/clip/linear.go b/clip/linear.go index e1da7d6..08db205 100644 --- a/clip/linear.go +++ b/clip/linear.go @@ -3,8 +3,8 @@ package clip import ( - "GoSlice/data" "fmt" + "github.com/aligator/goslice/data" clipper "github.com/aligator/go.clipper" ) diff --git a/cmd/goslice/main.go b/cmd/goslice/main.go index 8a2e0b9..6f8be92 100644 --- a/cmd/goslice/main.go +++ b/cmd/goslice/main.go @@ -1,9 +1,9 @@ package main import ( - "GoSlice" - "GoSlice/data" "fmt" + "github.com/aligator/goslice" + "github.com/aligator/goslice/data" "io" "os" @@ -26,7 +26,7 @@ func main() { os.Exit(1) } - p := GoSlice.NewGoSlice(o) + p := goslice.NewGoSlice(o) err := p.Process() if err != nil { diff --git a/data/2d_test.go b/data/2d_test.go index e7bb63e..4a8b4b6 100644 --- a/data/2d_test.go +++ b/data/2d_test.go @@ -1,8 +1,8 @@ package data_test import ( - "GoSlice/data" - "GoSlice/util/test" + "github.com/aligator/goslice/data" + "github.com/aligator/goslice/util/test" "math" "testing" ) diff --git a/data/data_test.go b/data/data_test.go index 21e7a5e..b5adc75 100644 --- a/data/data_test.go +++ b/data/data_test.go @@ -1,8 +1,8 @@ package data_test import ( - "GoSlice/data" - "GoSlice/util/test" + "github.com/aligator/goslice/data" + "github.com/aligator/goslice/util/test" "testing" ) diff --git a/data/layer_test.go b/data/layer_test.go index 5f17ab0..59e54da 100644 --- a/data/layer_test.go +++ b/data/layer_test.go @@ -1,8 +1,8 @@ package data_test import ( - "GoSlice/data" - "GoSlice/util/test" + "github.com/aligator/goslice/data" + "github.com/aligator/goslice/util/test" "github.com/google/go-cmp/cmp" "testing" ) diff --git a/data/micrometer_test.go b/data/micrometer_test.go index de3b2cd..ca3752b 100644 --- a/data/micrometer_test.go +++ b/data/micrometer_test.go @@ -1,8 +1,8 @@ package data_test import ( - "GoSlice/data" - "GoSlice/util/test" + "github.com/aligator/goslice/data" + "github.com/aligator/goslice/util/test" "github.com/google/go-cmp/cmp" "testing" ) diff --git a/data/option_test.go b/data/option_test.go index 15e6616..4a38868 100644 --- a/data/option_test.go +++ b/data/option_test.go @@ -1,8 +1,8 @@ package data_test import ( - "GoSlice/data" - "GoSlice/util/test" + "github.com/aligator/goslice/data" + "github.com/aligator/goslice/util/test" "github.com/google/go-cmp/cmp" "strings" "testing" diff --git a/gcode/builder.go b/gcode/builder.go index aa3f480..ae6a310 100644 --- a/gcode/builder.go +++ b/gcode/builder.go @@ -1,11 +1,11 @@ package gcode import ( - "GoSlice/clip" - "GoSlice/data" "bytes" "errors" "fmt" + "github.com/aligator/goslice/clip" + "github.com/aligator/goslice/data" "math" ) diff --git a/gcode/builder_test.go b/gcode/builder_test.go index 55bcd1e..dd16fca 100644 --- a/gcode/builder_test.go +++ b/gcode/builder_test.go @@ -1,9 +1,9 @@ package gcode_test import ( - "GoSlice/data" - "GoSlice/gcode" - "GoSlice/util/test" + "github.com/aligator/goslice/data" + "github.com/aligator/goslice/gcode" + "github.com/aligator/goslice/util/test" "testing" ) diff --git a/gcode/generator.go b/gcode/generator.go index 1901dbc..f673db6 100644 --- a/gcode/generator.go +++ b/gcode/generator.go @@ -2,8 +2,8 @@ package gcode import ( - "GoSlice/data" - "GoSlice/handler" + "github.com/aligator/goslice/data" + "github.com/aligator/goslice/handler" ) // Renderer can be used to add GCodes based on the current layer and layer data. diff --git a/gcode/generator_test.go b/gcode/generator_test.go index 7e0f7bf..be8c38b 100644 --- a/gcode/generator_test.go +++ b/gcode/generator_test.go @@ -1,9 +1,9 @@ package gcode_test import ( - "GoSlice/data" - "GoSlice/gcode" - "GoSlice/util/test" + "github.com/aligator/goslice/data" + "github.com/aligator/goslice/gcode" + "github.com/aligator/goslice/util/test" "testing" ) diff --git a/gcode/renderer/brim.go b/gcode/renderer/brim.go index a89e89d..a4ea6e4 100644 --- a/gcode/renderer/brim.go +++ b/gcode/renderer/brim.go @@ -2,9 +2,9 @@ package renderer import ( - "GoSlice/data" - "GoSlice/gcode" - "GoSlice/modifier" + "github.com/aligator/goslice/data" + "github.com/aligator/goslice/gcode" + "github.com/aligator/goslice/modifier" ) // Brim just draws the brim lines generated by the brim modifier. diff --git a/gcode/renderer/infill.go b/gcode/renderer/infill.go index 0652572..5936096 100644 --- a/gcode/renderer/infill.go +++ b/gcode/renderer/infill.go @@ -3,10 +3,10 @@ package renderer import ( - "GoSlice/clip" - "GoSlice/data" - "GoSlice/gcode" - "GoSlice/modifier" + "github.com/aligator/goslice/clip" + "github.com/aligator/goslice/data" + "github.com/aligator/goslice/gcode" + "github.com/aligator/goslice/modifier" ) // Infill is a renderer which can fill parts which are defined by a layer part attribute of a specific name. diff --git a/gcode/renderer/layer.go b/gcode/renderer/layer.go index 4fb243c..66c7c52 100644 --- a/gcode/renderer/layer.go +++ b/gcode/renderer/layer.go @@ -3,8 +3,8 @@ package renderer import ( - "GoSlice/data" - "GoSlice/gcode" + "github.com/aligator/goslice/data" + "github.com/aligator/goslice/gcode" ) // PreLayer adds starting gcode, resets the extrude speeds on each layer and enables the fan above a specific layer. diff --git a/gcode/renderer/perimeter.go b/gcode/renderer/perimeter.go index a349cd6..297308a 100644 --- a/gcode/renderer/perimeter.go +++ b/gcode/renderer/perimeter.go @@ -3,9 +3,9 @@ package renderer import ( - "GoSlice/data" - "GoSlice/gcode" - "GoSlice/modifier" + "github.com/aligator/goslice/data" + "github.com/aligator/goslice/gcode" + "github.com/aligator/goslice/modifier" ) // Perimeter is a renderer which generates the gcode for the attribute "perimeters". diff --git a/gcode/renderer/skirt.go b/gcode/renderer/skirt.go index 98dfc6a..0d3f988 100644 --- a/gcode/renderer/skirt.go +++ b/gcode/renderer/skirt.go @@ -3,11 +3,11 @@ package renderer import ( - "GoSlice/clip" - "GoSlice/data" - "GoSlice/gcode" - "GoSlice/modifier" "errors" + "github.com/aligator/goslice/clip" + "github.com/aligator/goslice/data" + "github.com/aligator/goslice/gcode" + "github.com/aligator/goslice/modifier" ) // Skirt generates the skirt lines. diff --git a/go.mod b/go.mod index 8e15281..dc34591 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module GoSlice +module github.com/aligator/goslice go 1.14 diff --git a/goslice.go b/goslice.go index d070843..0e2c733 100644 --- a/goslice.go +++ b/goslice.go @@ -1,17 +1,17 @@ -package GoSlice +package goslice import ( - "GoSlice/clip" - "GoSlice/data" - "GoSlice/gcode" - "GoSlice/gcode/renderer" - "GoSlice/handler" - "GoSlice/modifier" - "GoSlice/optimizer" - "GoSlice/reader" - "GoSlice/slicer" - "GoSlice/writer" "fmt" + "github.com/aligator/goslice/clip" + "github.com/aligator/goslice/data" + "github.com/aligator/goslice/gcode" + "github.com/aligator/goslice/gcode/renderer" + "github.com/aligator/goslice/handler" + "github.com/aligator/goslice/modifier" + "github.com/aligator/goslice/optimizer" + "github.com/aligator/goslice/reader" + "github.com/aligator/goslice/slicer" + "github.com/aligator/goslice/writer" "time" ) diff --git a/goslice_test.go b/goslice_test.go index 14b5434..6cf488d 100644 --- a/goslice_test.go +++ b/goslice_test.go @@ -1,8 +1,8 @@ -package GoSlice +package goslice import ( - "GoSlice/data" - "GoSlice/util/test" + "github.com/aligator/goslice/data" + "github.com/aligator/goslice/util/test" "testing" ) diff --git a/handler/handler.go b/handler/handler.go index 4164920..5eadcb0 100644 --- a/handler/handler.go +++ b/handler/handler.go @@ -2,7 +2,7 @@ package handler -import "GoSlice/data" +import "github.com/aligator/goslice/data" // ModelReader reads a model from a file. type ModelReader interface { diff --git a/modifier/brim.go b/modifier/brim.go index 75268d2..815fba6 100644 --- a/modifier/brim.go +++ b/modifier/brim.go @@ -1,10 +1,10 @@ package modifier import ( - "GoSlice/clip" - "GoSlice/data" - "GoSlice/handler" "fmt" + "github.com/aligator/goslice/clip" + "github.com/aligator/goslice/data" + "github.com/aligator/goslice/handler" ) type brimModifier struct { diff --git a/modifier/infill.go b/modifier/infill.go index 4d4941a..75be514 100644 --- a/modifier/infill.go +++ b/modifier/infill.go @@ -1,10 +1,10 @@ package modifier import ( - "GoSlice/clip" - "GoSlice/data" - "GoSlice/handler" "errors" + "github.com/aligator/goslice/clip" + "github.com/aligator/goslice/data" + "github.com/aligator/goslice/handler" ) type infillModifier struct { diff --git a/modifier/internal_infill.go b/modifier/internal_infill.go index f618b79..2e4ff8a 100644 --- a/modifier/internal_infill.go +++ b/modifier/internal_infill.go @@ -1,10 +1,10 @@ package modifier import ( - "GoSlice/clip" - "GoSlice/data" - "GoSlice/handler" "errors" + "github.com/aligator/goslice/clip" + "github.com/aligator/goslice/data" + "github.com/aligator/goslice/handler" ) type internalInfillModifier struct { diff --git a/modifier/modifier.go b/modifier/modifier.go index 3818ef3..c32d671 100644 --- a/modifier/modifier.go +++ b/modifier/modifier.go @@ -1,8 +1,8 @@ package modifier import ( - "GoSlice/data" "fmt" + "github.com/aligator/goslice/data" ) // extendedLayer is a partitioned layer which supports types diff --git a/modifier/perimeter.go b/modifier/perimeter.go index 61aef17..1e10bc8 100644 --- a/modifier/perimeter.go +++ b/modifier/perimeter.go @@ -1,10 +1,10 @@ package modifier import ( - "GoSlice/clip" - "GoSlice/data" - "GoSlice/handler" "errors" + "github.com/aligator/goslice/clip" + "github.com/aligator/goslice/data" + "github.com/aligator/goslice/handler" ) type perimeterModifier struct { diff --git a/modifier/support.go b/modifier/support.go index af673b3..55ac0f3 100644 --- a/modifier/support.go +++ b/modifier/support.go @@ -5,11 +5,11 @@ package modifier import ( - "GoSlice/clip" - "GoSlice/data" - "GoSlice/handler" "errors" "fmt" + "github.com/aligator/goslice/clip" + "github.com/aligator/goslice/data" + "github.com/aligator/goslice/handler" "math" ) diff --git a/optimizer/face.go b/optimizer/face.go index 8cbff85..436ce09 100644 --- a/optimizer/face.go +++ b/optimizer/face.go @@ -1,7 +1,7 @@ package optimizer import ( - "GoSlice/data" + "github.com/aligator/goslice/data" ) type optimizedFace struct { diff --git a/optimizer/model.go b/optimizer/model.go index beee720..46bf676 100644 --- a/optimizer/model.go +++ b/optimizer/model.go @@ -1,7 +1,7 @@ package optimizer import ( - "GoSlice/data" + "github.com/aligator/goslice/data" "github.com/hschendel/stl" ) diff --git a/optimizer/optimizer.go b/optimizer/optimizer.go index 150466b..912ebb6 100644 --- a/optimizer/optimizer.go +++ b/optimizer/optimizer.go @@ -22,9 +22,9 @@ package optimizer import ( - "GoSlice/data" - "GoSlice/handler" "fmt" + "github.com/aligator/goslice/data" + "github.com/aligator/goslice/handler" ) type optimizer struct { diff --git a/optimizer/point.go b/optimizer/point.go index 35af2da..66770f4 100644 --- a/optimizer/point.go +++ b/optimizer/point.go @@ -1,7 +1,7 @@ package optimizer import ( - "GoSlice/data" + "github.com/aligator/goslice/data" ) // point is a simple point together diff --git a/reader/reader.go b/reader/reader.go index ab4c673..ac66a84 100644 --- a/reader/reader.go +++ b/reader/reader.go @@ -1,8 +1,8 @@ package reader import ( - "GoSlice/data" - "GoSlice/handler" + "github.com/aligator/goslice/data" + "github.com/aligator/goslice/handler" "github.com/hschendel/stl" ) diff --git a/slicer/layer.go b/slicer/layer.go index 167bab5..c712849 100644 --- a/slicer/layer.go +++ b/slicer/layer.go @@ -1,7 +1,7 @@ package slicer import ( - "GoSlice/data" + "github.com/aligator/goslice/data" ) type layer struct { diff --git a/slicer/segment.go b/slicer/segment.go index eb87ceb..5ebf638 100644 --- a/slicer/segment.go +++ b/slicer/segment.go @@ -1,7 +1,7 @@ package slicer import ( - "GoSlice/data" + "github.com/aligator/goslice/data" ) // segment is a line specified by two points. diff --git a/slicer/slicer.go b/slicer/slicer.go index 43597fe..d548e7f 100644 --- a/slicer/slicer.go +++ b/slicer/slicer.go @@ -15,10 +15,10 @@ package slicer import ( - "GoSlice/clip" - "GoSlice/data" - "GoSlice/handler" "fmt" + "github.com/aligator/goslice/clip" + "github.com/aligator/goslice/data" + "github.com/aligator/goslice/handler" ) type slicer struct { diff --git a/writer/writer.go b/writer/writer.go index dd49b02..a211f89 100644 --- a/writer/writer.go +++ b/writer/writer.go @@ -1,8 +1,8 @@ package writer import ( - "GoSlice/handler" "fmt" + "github.com/aligator/goslice/handler" "os" )