Skip to content

Commit

Permalink
Add some support
Browse files Browse the repository at this point in the history
  • Loading branch information
skjolber committed Dec 7, 2023
1 parent 66367ff commit 4e469e8
Show file tree
Hide file tree
Showing 6 changed files with 157 additions and 39 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.github.skjolber.packing.api;

import java.io.Serializable;

public class HorizontalSupport implements Serializable {

private static final long serialVersionUID = 1L;

private final SupportPlacement3D negative;
private final SupportPlacement3D positive;

private final long area;

public HorizontalSupport(SupportPlacement3D negative, SupportPlacement3D positive, long area) {
super();
this.negative = negative;
this.positive = positive;
this.area = area;
}

public SupportPlacement3D getNegative() {
return negative;
}

public SupportPlacement3D getPositive() {
return positive;
}

public long getArea() {
return area;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.github.skjolber.packing.api;

import java.util.List;

import com.github.skjolber.packing.api.Surface.Label;

public interface SupportPlacement3D extends Placement3D {

List<VerticalSupport> getBottomSupports();

List<VerticalSupport> getTopSupports();

List<HorizontalSupport> getLeftSupports();

List<HorizontalSupport> getRightSupports();

List<HorizontalSupport> getFrontSupports();

List<HorizontalSupport> getRearSupports();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package com.github.skjolber.packing.api;

import java.util.List;

public class SupportStackPlacement extends StackPlacement implements SupportPlacement3D {

private static final long serialVersionUID = 1L;

protected List<VerticalSupport> bottomSupports;

protected List<VerticalSupport> topSupports;

protected List<HorizontalSupport> leftSupports;

protected List<HorizontalSupport> rightSupports;

protected List<HorizontalSupport> frontSupports;

protected List<HorizontalSupport> rearSupports;

public SupportStackPlacement() {
super();
}

public SupportStackPlacement(Stackable stackable, StackValue value, int x, int y, int z) {
super(stackable, value, x, y, z);
}

@Override
public List<VerticalSupport> getBottomSupports() {
return bottomSupports;
}

@Override
public List<VerticalSupport> getTopSupports() {
return topSupports;
}

@Override
public List<HorizontalSupport> getLeftSupports() {
return leftSupports;
}

@Override
public List<HorizontalSupport> getRightSupports() {
return rightSupports;
}

@Override
public List<HorizontalSupport> getFrontSupports() {
return frontSupports;
}

@Override
public List<HorizontalSupport> getRearSupports() {
return rearSupports;
}

}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package com.github.skjolber.packing.api;

import java.io.Serializable;

public class VerticalSupport implements Serializable {

private static final long serialVersionUID = 1L;

private final SupportPlacement3D negative;
private final SupportPlacement3D positive;

private final long area;

private int weightLimit;

public VerticalSupport(SupportPlacement3D negative, SupportPlacement3D positive, long area, int weightLimit) {
super();
this.negative = negative;
this.positive = positive;
this.area = area;
this.weightLimit = weightLimit;
}

public SupportPlacement3D getNegative() {
return negative;
}

public SupportPlacement3D getPositive() {
return positive;
}

public long getArea() {
return area;
}

public void decrementWeightLimit(int weightLimit) {
this.weightLimit -= weightLimit;
}

public int getWeightLimit() {
return weightLimit;
}

}

0 comments on commit 4e469e8

Please sign in to comment.