Skip to content

Commit f5f2f74

Browse files
committed
fix: remove unused function exports
1 parent 4e4353d commit f5f2f74

File tree

1 file changed

+1
-46
lines changed

1 file changed

+1
-46
lines changed

src/bundles/csg/functions.ts

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -36,51 +36,6 @@ import {
3636
} from './utilities';
3737
import { type List } from './types';
3838

39-
/**
40-
* Colour the shape using the specified hex colour code.
41-
*
42-
* @param {Shape} shape - The Shape to be coloured and returned
43-
* @param {string} hex - The colour code to use
44-
* @returns {Shape} The colorized shape
45-
*/
46-
function colorize(shape: Shape, hex: string) {
47-
let color: Color = hexToColor(hex);
48-
let coloredSolid: Solid = _colorize(color, shape.solid);
49-
return new Shape(coloredSolid);
50-
}
51-
52-
/**
53-
* Returns a lambda function that contains the center of the given shape in the
54-
* x, y and z direction. Providing 'x', 'y', 'z' as input would return x, y and
55-
* z coordinates of shape's center
56-
*
57-
* For example
58-
* ````
59-
* const a = shape_center(sphere);
60-
* a('x'); // Returns the x coordinate of the shape's center
61-
* ````
62-
*
63-
* @param {Shape} shape - The scale to be measured
64-
* @returns {(String) => number} A lambda function providing the shape's center
65-
* coordinates
66-
*/
67-
function shape_center(shape: Shape): (axis: String) => number {
68-
let bounds: BoundingBox = measureBoundingBox(shape.solid);
69-
let centerCoords: Coordinates = [
70-
bounds[0][0] + (bounds[1][0] - bounds[0][0]) / 2,
71-
bounds[0][1] + (bounds[1][1] - bounds[0][1]) / 2,
72-
bounds[0][2] + (bounds[1][2] - bounds[0][2]) / 2,
73-
];
74-
return (axis: String): number => {
75-
let i: number = axis === 'x' ? 0 : axis === 'y' ? 1 : axis === 'z' ? 2 : -1;
76-
if (i === -1) {
77-
throw Error("shape_center's returned function expects a proper axis.");
78-
} else {
79-
return centerCoords[i];
80-
}
81-
};
82-
}
83-
8439
/**
8540
* Center the provided shape with the middle base of the shape at (0, 0, 0).
8641
*
@@ -500,7 +455,7 @@ export function intersect(a: Shape, b: Shape): Shape {
500455
* @returns {Shape} Resulting Shape
501456
*/
502457
export function scale(entity: Entity, x: number, y: number, z: number): Entity {
503-
if (x === 0 || y === 0 || z === 0) {
458+
if (x <= 0 || y <= 0 || z <= 0) {
504459
throw new Error('factors must be non-zero');
505460
}
506461
return entity.scale([x, y, z]);

0 commit comments

Comments
 (0)