Skip to content

Commit

Permalink
WASM bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
cartesian-theatrics committed Jul 4, 2023
1 parent 3615e8b commit 327ccbc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions bindings/wasm/bindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ Module.setup = function() {
return (center ? man.translate([0., 0., -height / 2.]) : man);
};

Module.CrossSection.prototype.revolve = function(circularSegments = 0) {
return Module._Revolve(this, circularSegments);
Module.CrossSection.prototype.revolve = function(circularSegments = 0, revolveDegrees = 360.0) {
return Module._Revolve(this, circularSegments, revolveDegrees);
};

Module.CrossSection.prototype.add = function(other) {
Expand Down Expand Up @@ -555,11 +555,11 @@ Module.setup = function() {
return cs.extrude(height, nDivisions, twistDegrees, scaleTop, center);
};

Module.Manifold.revolve = function(polygons, circularSegments = 0) {
Module.Manifold.revolve = function(polygons, circularSegments = 0, revolveDegrees = 360.0) {
const cs = (polygons instanceof CrossSectionCtor) ?
polygons :
Module.CrossSection(polygons, 'Positive');
return cs.revolve(circularSegments);
return cs.revolve(circularSegments, revolveDegrees);
};

Module.Manifold.reserveIDs = function(n) {
Expand Down
3 changes: 2 additions & 1 deletion bindings/wasm/manifold-encapsulated-types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,9 @@ export class Manifold {
* @param polygons A set of non-overlapping polygons to revolve.
* @param circularSegments Number of segments along its diameter. Default is
* calculated by the static Defaults.
* @param revolveDegrees Number of degrees to revolve. Default is 360 degrees.
*/
static revolve(polygons: CrossSection|Polygons, circularSegments?: number):
static revolve(polygons: CrossSection|Polygons, circularSegments?: number, revolveDegrees?: number):
Manifold;

// Mesh Conversion
Expand Down

0 comments on commit 327ccbc

Please sign in to comment.