-
Notifications
You must be signed in to change notification settings - Fork 218
Open
Labels
Description
Module and/or Feature
CylinderGeometry
Description
It seems that CylinderGeometry
should accept all props for TruncatedConeGeometry
in addition to the defined CylinderGeometryProps
.
// works but triggers a Typescript warning:
// Object literal may only specify known properties, and 'height' does not exist in type 'CylinderGeometryProps'
new CylinderGeometry({ radius: 1, height: 2 })
Suggested solution
// src/geometries/cylinder-geometry.ts
- import {TruncatedConeGeometry} from './truncated-cone-geometry';
+ import {TruncatedConeGeometry, TruncatedConeGeometryProps} from './truncated-cone-geometry';
import {uid} from '../utils/uid';
export type CylinderGeometryProps = {
id?: string;
radius?: number;
attributes?: any;
- };
+ } & TruncatedConeGeometryProps;
export class CylinderGeometry extends TruncatedConeGeometry {
constructor(props: CylinderGeometryProps = {}) {
const {id = uid('cylinder-geometry'), radius = 1} = props;
super({
...props,
id,
bottomRadius: radius,
topRadius: radius
});
}
}
Expected Behavior
No response
Steps to Reproduce
Environment
Logs
Object literal may only specify known properties, and 'height' does not exist in type 'CylinderGeometryProps'
JeffThorslund and orteth01