未验证 提交 9522135f 编写于 作者: L Luis E. Fraguada 提交者: GitHub

3dmLoader: Updates (#21347)

* extract name and value properties from objects

* Extract object userStrings
上级 312ee7b0
......@@ -1247,11 +1247,16 @@ Rhino3dmLoader.Rhino3dmWorker = function () {
}
if ( _geometry.userStringCount > 0 ) {
attributes.geometry.userStrings = _geometry.getUserStrings();
}
attributes.drawColor = _attributes.drawColor( doc );
objectType = objectType.constructor.name;
objectType = objectType.substring( 11, objectType.length );
attributes.geometry.objectType = objectType;
return { geometry, attributes, objectType };
......@@ -1269,13 +1274,24 @@ Rhino3dmLoader.Rhino3dmWorker = function () {
for ( var property in object ) {
if ( typeof object[ property ] !== 'function' ) {
var value = object[ property ];
if ( typeof value !== 'function' ) {
if ( typeof value === 'object' && value !== null && value.hasOwnProperty( 'constructor' ) ) {
result[ property ] = object[ property ];
result[ property ] = { name: value.constructor.name, value: value.value };
} else {
result[ property ] = value;
}
} else {
// console.log( `${property}: ${object[ property ]}` );
// these are functions that could be called to extract more data.
//console.log( `${property}: ${object[ property ].constructor.name}` );
}
......@@ -1368,7 +1384,7 @@ Rhino3dmLoader.Rhino3dmWorker = function () {
var tan = curve.tangentAt( t );
var prevTan = curve.tangentAt( ts.slice( - 1 )[ 0 ] );
// Duplicaated from THREE.Vector3
// Duplicated from THREE.Vector3
// How to pass imports to worker?
var tS = tan[ 0 ] * tan[ 0 ] + tan[ 1 ] * tan[ 1 ] + tan[ 2 ] * tan[ 2 ];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册