diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index 22e7b660..b8d31248 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -5,7 +5,6 @@ import { Material, Mesh, MeshBasicMaterial, - MeshStandardMaterial, Object3D, Quaternion, TorusGeometry, @@ -134,14 +133,6 @@ export function assertIsMeshBasicMaterial( } } -export function assertIsMaterialWithColor( - val: any, -): asserts val is MeshBasicMaterial { - if (!('color' in val)) { - throw new TypeError(`Expected 'val' to be MeshBasicMaterial with color`); - } -} - export function assertBehavesLikeArray(val: any): asserts val is Array { if (val.length === undefined) { throw new TypeError(`Expected 'val' to be an array`); diff --git a/src/utils/transform.ts b/src/utils/transform.ts index 454cf0af..9a5f24cf 100644 --- a/src/utils/transform.ts +++ b/src/utils/transform.ts @@ -1,5 +1,5 @@ import { Color, Mesh, Object3D, Quaternion } from 'three'; -import { assertIsMaterialWithColor } from './helpers'; +import { assertIsMaterial } from './helpers'; import Line from '../primitives/Line'; import LineSegments from '../primitives/LineSegment'; @@ -28,10 +28,7 @@ export const setColor = ( object: Mesh | Line | LineSegments, color: string | number | RosMessage.Color, ) => { - console.log("¡¡¡¡ assertIsMeshBasicMaterial !!!!") - console.log(object) - assertIsMaterialWithColor(object.material); - + assertIsMaterial(object.material); if (typeof color === 'string' || typeof color === 'number') { object.material.color = new Color(color); } else {