From cee09c059313c508d58656561b837f84de02637b Mon Sep 17 00:00:00 2001 From: Carlos Date: Fri, 12 Jun 2020 11:06:29 +0200 Subject: [PATCH] Revert "Fixed: https://github.com/rapyuta-robotics/zethus/issues/88" This reverts commit 270e5c61ef298a40a683ea5abe72e5877a16b73b. --- src/utils/helpers.ts | 9 --------- src/utils/transform.ts | 7 ++----- 2 files changed, 2 insertions(+), 14 deletions(-) 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 {