Skip to content

Commit

Permalink
static lib
Browse files Browse the repository at this point in the history
  • Loading branch information
cartesian-theatrics committed Apr 1, 2024
1 parent 0e38011 commit 7540cf6
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 8 deletions.
3 changes: 0 additions & 3 deletions bindings/java/src/main/java/manifold3d/Manifold.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public class Manifold extends Pointer {
if (osName.contains("linux")) {
try {
System.load(Loader.extractResource("/libfreetype.so", null, "libfreetype", ".so").getAbsolutePath());
System.load(Loader.extractResource("/libTextToPolygon.so", null, "libTextToPolygon", ".so").getAbsolutePath());
System.load(Loader.extractResource("/libmeshIO.so", null, "libmeshIO", ".so").getAbsolutePath());
System.load(Loader.extractResource("/libmeshIO.so", null, "libmeshIO", ".so").getAbsolutePath());
System.load(Loader.extractResource("/libClipper2.so", null, "libClipper2", ".so").getAbsolutePath());
Expand All @@ -70,8 +69,6 @@ public class Manifold extends Pointer {
try {
System.out.println("Loading freetype");
System.load(Loader.extractResource("/libfreetype.6.16.0.dylib", null, "libfreetype", ".dylib").getAbsolutePath());
System.out.println("Loading textToPolygon");
System.load(Loader.extractResource("/libTextToPolygon.dylib", null, "libTextToPolygon", ".dylib").getAbsolutePath());
System.out.println("Loading meshIO");
System.load(Loader.extractResource("/libmeshIO.dylib", null, "libmeshIO", ".dylib").getAbsolutePath());
System.out.println("Loading Manifold");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public CrossSection translateY(double y) {
public static native @ByVal CrossSection Compose(@ByRef CrossSectionVector crossSection);
@Name("Decompose") public native @ByVal CrossSectionVector decompose();

public static native @ByVal CrossSection Text(@ByRef @StdString String fontFile, @ByRef @StdString String text, int pixelHeight, int interpRes);
public static native @ByVal CrossSection Text(@ByRef @StdString String fontFile, @ByRef @StdString String text, int pixelHeight, int interpRes, @Cast("manifold::CrossSection::FillRule") int fillRule);
public static native @ByVal CrossSection Circle(float radius, int circularSegments);
public static native @ByVal CrossSection Square(@ByRef DoubleVec2 size, boolean center);
public static CrossSection Square(double x, double y, boolean center) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void testCrossSection() {
CrossSection innerSection = new CrossSection(innerPolygon, FillRule.NonZero.ordinal())
.translate(new DoubleVec2(3, 0));

CrossSection text = CrossSection.Text("DejaVuSans.ttf", "abcdefghijk lmnopqrstuvwxyz", 48, 6);
CrossSection text = CrossSection.Text("DejaVuSans.ttf", "abcdefghijk lmnopqrstuvwxyz", 48, 6, FillRule.NonZero.ordinal());

CrossSection circle = CrossSection.Circle(3.0f, 20);
Manifold cylinder = Manifold.Extrude(circle, 50, 60, 0, new DoubleVec2(1.0, 1.0));
Expand Down
2 changes: 1 addition & 1 deletion src/cross_section/include/cross_section.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class CrossSection {
CrossSection(const Polygons& contours,
FillRule fillrule = FillRule::Positive);
CrossSection(const Rect& rect);
static CrossSection Text(const std::string& fontFile, const std::string& text, u_int32_t pixelHeight, int interpRes);
static CrossSection Text(const std::string& fontFile, const std::string& text, u_int32_t pixelHeight, int interpRes, FillRule fillRule);
static CrossSection Square(const glm::vec2 dims, bool center = false);
static CrossSection Circle(float radius, int circularSegments = 0);
///@}
Expand Down
4 changes: 2 additions & 2 deletions src/cross_section/src/cross_section.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,9 @@ std::shared_ptr<const PathImpl> CrossSection::GetPaths() const {
* @param pixelHeight freetype pixelHeight.
* @param interpRes Resolution of interpolation of curves.
*/
CrossSection CrossSection::Text(const std::string& fontFile, const std::string& text, u_int32_t pixelHeight, int interpRes) {
CrossSection CrossSection::Text(const std::string& fontFile, const std::string& text, u_int32_t pixelHeight, int interpRes, FillRule fillRule) {
Polygons polys = TextToPolygon::textToPolygons(fontFile, text, pixelHeight, interpRes);
return CrossSection(polys, FillRule::NonZero);
return CrossSection(polys, fillRule);
}

/**
Expand Down

0 comments on commit 7540cf6

Please sign in to comment.