Skip to content
edankoPublic

About

Shipbuilding profile nesting CLI: parses production TXT/DXF/AVEVA/GEN, nests parts onto stock bars, and writes MGF, TXT and Excel reports

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

moses

Test Lint Security

Shipbuilding production profile nesting tool. It reads the formats the yard actually produces, nests profiles onto stock bars, and writes machine output.

Supported inputs:

  • pre-nested production TXT (parser)
  • Cadmatic profile-report DXF (conv 10022)
  • AVEVA "Profile sketch & list" CSV + LST (conv 10510)
  • AVEVA marine GEN (conv 10510gen)

Outputs are MGF for the IMG cutting machine, nested TXT, bar/nesting reports, an Excel workbook, and the remnant CSV.

Install and build

go build -o moses ./cmd/moses
# or
make build

Version, commit and build time are injected with -ldflags.

Commands

moses parser [--in DIR] [--out DIR] [--dont-rename]
moses conv 10022   --in DIR --out DIR
moses conv 10510   --in DIR --out DIR --project PROJECT
moses conv 10510gen --in DIR --out DIR --project PROJECT
moses version

Global flag: --config FILE (default config.yaml). Converter flags: --remnants FILE (default: remnants.file from config) and --algorithm NAME (best-fit-decreasing by default; knapsack is also available).

moses parser writes out/<project>/<section>/<nest>.mgf and <nest>_strightcut.txt, and prefixes consumed input files with _ unless --dont-rename is set.

Converters write, under --out:

txt/<project>-<section>_<DIM>_<QUALITY>.txt
<project>-<section>_bar.txt
<project>-<section>_nst.txt
<project>-<section>.xlsx

conv 10022 does not write Excel. Remnants are read from and written to remnants.csv in the working directory unless overridden.

Configuration

Moses uses a versioned YAML configuration. version: 2 is required; unknown fields are rejected. Values are merged over embedded geometry defaults, so a site config only needs its spacing/stock overrides.

version: 2

defaults:
  stockLength: 12000
  endcutSpacing: 5

remnants:
  enabled: true
  minLength: 1100
  file: remnants.csv

families:
  hp:
    prefixes: [rp, pp]
    stockLength: 12000
    endcutSpacing: 5
    endcuts:
      "21":
        profiles:
          rp160x8: 8
  fb:
    prefixes: [fb]
  ae:
    prefixes: [ae]
    stockLength: 11200

Resolution is explicit and fails loudly:

  • spacing: profile → endcut default → family default → defaults.endcutSpacing
  • stock length: profile → family → defaults.stockLength
  • geometry: profiles.<type>; FB is derived from the type

A complete example is in config.example.yaml.

Performance

Benchmarks and profiling notes are in docs/PERFORMANCE.md.

Development

make test         # go test ./...
make test-race    # go test -race -shuffle=on -count=1 ./...
make bench        # pipeline benchmarks
make lint         # go vet + golangci-lint
make lint-fix     # golangci-lint --fix
make lint-config  # validate .golangci.yml
make format       # gofmt -w
make format-check # fail if sources are not formatted
make mod-check    # fail if go.mod/go.sum are not tidy
make verify       # format, mod, lint and race tests
make help         # list targets

CI runs the same gates from .github/workflows/: tests and build in test.yml, golangci-lint in lint.yml, and govulncheck in security.yml.

testdata/ contains real TXT/GEN samples and oracle MGF output. Checked-in configuration fixtures for the pipeline tests live under internal/config/testdata/v2.

About

Shipbuilding profile nesting CLI: parses production TXT/DXF/AVEVA/GEN, nests parts onto stock bars, and writes MGF, TXT and Excel reports

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages