Skip to content

Commit

Permalink
Surfaces are occasionally missed. #42
Browse files Browse the repository at this point in the history
Reverting back to occt version 7.6.1.
  • Loading branch information
kovacsv committed Dec 2, 2024
1 parent 8bd91e1 commit 29b7591
Show file tree
Hide file tree
Showing 6 changed files with 270 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ All functions have two parameters:
- `params`: Triangulation parameters as an object, can be `null`.
- `linearUnit`: Defines the linear unit of the output. Possible values: `millimeter`, `centimeter`, `meter`, `inch`, `foot`. Default is `millimeter`. Has no effect on brep files.
- `linearDeflectionType`: Defines what the linear deflection value means. Default is `bounding_box_ratio`. Possible values:
- `bounding_box_ratio`: The `linearDeflection` value contains a ratio of the avarage bounding box.
- `bounding_box_ratio`: The `linearDeflection` value contains a ratio of the average bounding box.
- `absolute_value`: The `linearDeflection` value contains an absolute value in the unit defined by `linearUnit`.
- `linearDeflection`: The linear deflection value based on the value of the `linearDeflectionType` parameter.
- `angularDeflection`: The angular deflection value.
Expand Down
2 changes: 1 addition & 1 deletion dist/occt-import-js.js

Large diffs are not rendered by default.

Binary file modified dist/occt-import-js.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion occt
Submodule occt updated from bd2a78 to d2abb6
18 changes: 18 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,24 @@ it ('cube-fcstd', function () {
]);
});

it ('conical-surface', function () {
let result = LoadStepFile ('./test/testfiles/conical-surface/conical-surface.step');
assert (result.success);
assert.deepStrictEqual (result.root, {
name : "",
meshes : [],
children : [
{
name : "(Unsaved)",
meshes : [ 0 ],
children : []
}
]
});
assert.strictEqual (result.meshes.length, 1);
assert.equal (3954, result.meshes[0].index.array.length);
});

});

describe ('Iges Import', function () {
Expand Down
249 changes: 249 additions & 0 deletions test/testfiles/conical-surface/conical-surface.step
Original file line number Diff line number Diff line change
@@ -0,0 +1,249 @@
ISO-10303-21;
HEADER;
/* Generated by software containing ST-Developer
* from STEP Tools, Inc. (www.steptools.com)
*/

FILE_DESCRIPTION(
/* description */ (''),
/* implementation_level */ '2;1');

FILE_NAME(
/* name */ 'test2.step',
/* time_stamp */ '2024-08-18T19:46:42-04:00',
/* author */ (''),
/* organization */ (''),
/* preprocessor_version */ 'ST-DEVELOPER v20',
/* originating_system */ 'Autodesk Translation Framework v13.14.0.145',

/* authorisation */ '');

FILE_SCHEMA (('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }'));
ENDSEC;

DATA;
#10=MECHANICAL_DESIGN_GEOMETRIC_PRESENTATION_REPRESENTATION('',(#13),#150);
#11=SHAPE_REPRESENTATION_RELATIONSHIP('SRR','None',#160,#12);
#12=ADVANCED_BREP_SHAPE_REPRESENTATION('',(#14),#149);
#13=STYLED_ITEM('',(#170),#14);
#14=MANIFOLD_SOLID_BREP('Body1',#79);
#15=CONICAL_SURFACE('',#102,0.450944881889764,0.785398163397449);
#16=FACE_BOUND('',#27,.T.);
#17=FACE_BOUND('',#29,.T.);
#18=PLANE('',#96);
#19=PLANE('',#98);
#20=FACE_OUTER_BOUND('',#25,.T.);
#21=FACE_OUTER_BOUND('',#26,.T.);
#22=FACE_OUTER_BOUND('',#28,.T.);
#23=FACE_OUTER_BOUND('',#30,.T.);
#24=FACE_OUTER_BOUND('',#31,.T.);
#25=EDGE_LOOP('',(#56,#57,#58,#59));
#26=EDGE_LOOP('',(#60));
#27=EDGE_LOOP('',(#61));
#28=EDGE_LOOP('',(#62));
#29=EDGE_LOOP('',(#63));
#30=EDGE_LOOP('',(#64,#65,#66,#67));
#31=EDGE_LOOP('',(#68,#69,#70,#71));
#32=LINE('',#133,#35);
#33=LINE('',#143,#36);
#34=LINE('',#146,#37);
#35=VECTOR('',#109,0.532145256772786);
#36=VECTOR('',#122,0.216535433070866);
#37=VECTOR('',#127,0.450944881889764);
#38=CIRCLE('',#94,0.532145256772786);
#39=CIRCLE('',#95,0.532145256772786);
#40=CIRCLE('',#97,0.450944881889764);
#41=CIRCLE('',#99,0.216535433070866);
#42=CIRCLE('',#101,0.216535433070866);
#43=VERTEX_POINT('',#130);
#44=VERTEX_POINT('',#132);
#45=VERTEX_POINT('',#136);
#46=VERTEX_POINT('',#139);
#47=VERTEX_POINT('',#142);
#48=EDGE_CURVE('',#43,#43,#38,.T.);
#49=EDGE_CURVE('',#43,#44,#32,.T.);
#50=EDGE_CURVE('',#44,#44,#39,.T.);
#51=EDGE_CURVE('',#45,#45,#40,.T.);
#52=EDGE_CURVE('',#46,#46,#41,.T.);
#53=EDGE_CURVE('',#46,#47,#33,.T.);
#54=EDGE_CURVE('',#47,#47,#42,.T.);
#55=EDGE_CURVE('',#47,#45,#34,.T.);
#56=ORIENTED_EDGE('',*,*,#48,.T.);
#57=ORIENTED_EDGE('',*,*,#49,.T.);
#58=ORIENTED_EDGE('',*,*,#50,.T.);
#59=ORIENTED_EDGE('',*,*,#49,.F.);
#60=ORIENTED_EDGE('',*,*,#50,.F.);
#61=ORIENTED_EDGE('',*,*,#51,.F.);
#62=ORIENTED_EDGE('',*,*,#48,.F.);
#63=ORIENTED_EDGE('',*,*,#52,.T.);
#64=ORIENTED_EDGE('',*,*,#52,.F.);
#65=ORIENTED_EDGE('',*,*,#53,.T.);
#66=ORIENTED_EDGE('',*,*,#54,.T.);
#67=ORIENTED_EDGE('',*,*,#53,.F.);
#68=ORIENTED_EDGE('',*,*,#54,.F.);
#69=ORIENTED_EDGE('',*,*,#55,.T.);
#70=ORIENTED_EDGE('',*,*,#51,.T.);
#71=ORIENTED_EDGE('',*,*,#55,.F.);
#72=CYLINDRICAL_SURFACE('',#93,0.532145256772786);
#73=CYLINDRICAL_SURFACE('',#100,0.216535433070866);
#74=ADVANCED_FACE('',(#20),#72,.T.);
#75=ADVANCED_FACE('',(#21,#16),#18,.F.);
#76=ADVANCED_FACE('',(#22,#17),#19,.F.);
#77=ADVANCED_FACE('',(#23),#73,.F.);
#78=ADVANCED_FACE('',(#24),#15,.F.);
#79=CLOSED_SHELL('',(#74,#75,#76,#77,#78));
#80=DERIVED_UNIT_ELEMENT(#82,1.);
#81=DERIVED_UNIT_ELEMENT(#154,-3.);
#82=(
MASS_UNIT()
NAMED_UNIT(*)
SI_UNIT(.KILO.,.GRAM.)
);
#83=DERIVED_UNIT((#80,#81));
#84=MEASURE_REPRESENTATION_ITEM('density measure',
POSITIVE_RATIO_MEASURE(7850.),#83);
#85=PROPERTY_DEFINITION_REPRESENTATION(#90,#87);
#86=PROPERTY_DEFINITION_REPRESENTATION(#91,#88);
#87=REPRESENTATION('material name',(#89),#149);
#88=REPRESENTATION('density',(#84),#149);
#89=DESCRIPTIVE_REPRESENTATION_ITEM('Steel','Steel');
#90=PROPERTY_DEFINITION('material property','material name',#162);
#91=PROPERTY_DEFINITION('material property','density of part',#162);
#92=AXIS2_PLACEMENT_3D('',#128,#103,#104);
#93=AXIS2_PLACEMENT_3D('',#129,#105,#106);
#94=AXIS2_PLACEMENT_3D('',#131,#107,#108);
#95=AXIS2_PLACEMENT_3D('',#134,#110,#111);
#96=AXIS2_PLACEMENT_3D('',#135,#112,#113);
#97=AXIS2_PLACEMENT_3D('',#137,#114,#115);
#98=AXIS2_PLACEMENT_3D('',#138,#116,#117);
#99=AXIS2_PLACEMENT_3D('',#140,#118,#119);
#100=AXIS2_PLACEMENT_3D('',#141,#120,#121);
#101=AXIS2_PLACEMENT_3D('',#144,#123,#124);
#102=AXIS2_PLACEMENT_3D('',#145,#125,#126);
#103=DIRECTION('axis',(0.,0.,1.));
#104=DIRECTION('refdir',(1.,0.,0.));
#105=DIRECTION('center_axis',(1.,0.,0.));
#106=DIRECTION('ref_axis',(0.,-1.,0.));
#107=DIRECTION('center_axis',(-1.,0.,0.));
#108=DIRECTION('ref_axis',(0.,-1.,0.));
#109=DIRECTION('',(-1.,0.,0.));
#110=DIRECTION('center_axis',(1.,0.,0.));
#111=DIRECTION('ref_axis',(0.,-1.,0.));
#112=DIRECTION('center_axis',(1.,0.,0.));
#113=DIRECTION('ref_axis',(0.,0.,-1.));
#114=DIRECTION('center_axis',(-1.,0.,0.));
#115=DIRECTION('ref_axis',(0.,-1.,1.04744440165294E-14));
#116=DIRECTION('center_axis',(-1.,0.,0.));
#117=DIRECTION('ref_axis',(0.,0.,1.));
#118=DIRECTION('center_axis',(-1.,0.,0.));
#119=DIRECTION('ref_axis',(0.,-1.,1.04744440165294E-14));
#120=DIRECTION('center_axis',(-1.,0.,0.));
#121=DIRECTION('ref_axis',(0.,-1.,1.04744440165294E-14));
#122=DIRECTION('',(-1.,0.,0.));
#123=DIRECTION('center_axis',(-1.,0.,0.));
#124=DIRECTION('ref_axis',(0.,-1.,1.04744440165294E-14));
#125=DIRECTION('center_axis',(-1.,0.,0.));
#126=DIRECTION('ref_axis',(0.,-1.,1.04744440165294E-14));
#127=DIRECTION('',(-0.707106781186547,0.707106781186548,-7.49314599887035E-15));
#128=CARTESIAN_POINT('',(0.,0.,0.));
#129=CARTESIAN_POINT('Origin',(-0.748031496062992,1.13404413564787E-14,
1.08267716535433));
#130=CARTESIAN_POINT('',(-0.47244094488189,0.532145256772798,1.08267716535433));
#131=CARTESIAN_POINT('Origin',(-0.47244094488189,1.13404413564787E-14,1.08267716535433));
#132=CARTESIAN_POINT('',(-0.748031496062992,0.532145256772798,1.08267716535433));
#133=CARTESIAN_POINT('',(-0.748031496062992,0.532145256772798,1.08267716535433));
#134=CARTESIAN_POINT('Origin',(-0.748031496062992,1.13404413564787E-14,
1.08267716535433));
#135=CARTESIAN_POINT('Origin',(-0.748031496062992,1.53543307086614,0.));
#136=CARTESIAN_POINT('',(-0.748031496062992,0.450944881889775,1.08267716535433));
#137=CARTESIAN_POINT('Origin',(-0.748031496062992,1.13404413564787E-14,
1.08267716535433));
#138=CARTESIAN_POINT('Origin',(-0.47244094488189,0.486811025,0.));
#139=CARTESIAN_POINT('',(-0.47244094488189,0.216535433070877,1.08267716535433));
#140=CARTESIAN_POINT('Origin',(-0.47244094488189,1.13404413564787E-14,1.08267716535433));
#141=CARTESIAN_POINT('Origin',(-0.748031496062992,1.13404413564787E-14,
1.08267716535433));
#142=CARTESIAN_POINT('',(-0.513622047244094,0.216535433070877,1.08267716535433));
#143=CARTESIAN_POINT('',(-0.748031496062992,0.216535433070877,1.08267716535433));
#144=CARTESIAN_POINT('Origin',(-0.513622047244094,1.13404413564787E-14,
1.08267716535433));
#145=CARTESIAN_POINT('Origin',(-0.748031496062992,1.13404413564787E-14,
1.08267716535433));
#146=CARTESIAN_POINT('',(-0.748031496062992,0.450944881889775,1.08267716535433));
#147=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(0.000393700787401575),
#152,'DISTANCE_ACCURACY_VALUE',
'Maximum model space distance between geometric entities at asserted c
onnectivities');
#148=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(0.000393700787401575),
#152,'DISTANCE_ACCURACY_VALUE',
'Maximum model space distance between geometric entities at asserted c
onnectivities');
#149=(
GEOMETRIC_REPRESENTATION_CONTEXT(3)
GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#147))
GLOBAL_UNIT_ASSIGNED_CONTEXT((#152,#156,#157))
REPRESENTATION_CONTEXT('','3D')
);
#150=(
GEOMETRIC_REPRESENTATION_CONTEXT(3)
GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#148))
GLOBAL_UNIT_ASSIGNED_CONTEXT((#152,#156,#157))
REPRESENTATION_CONTEXT('','3D')
);
#151=DIMENSIONAL_EXPONENTS(1.,0.,0.,0.,0.,0.,0.);
#152=(
CONVERSION_BASED_UNIT('inch',#155)
LENGTH_UNIT()
NAMED_UNIT(#151)
);
#153=(
LENGTH_UNIT()
NAMED_UNIT(*)
SI_UNIT(.MILLI.,.METRE.)
);
#154=(
LENGTH_UNIT()
NAMED_UNIT(*)
SI_UNIT($,.METRE.)
);
#155=LENGTH_MEASURE_WITH_UNIT(LENGTH_MEASURE(25.4),#153);
#156=(
NAMED_UNIT(*)
PLANE_ANGLE_UNIT()
SI_UNIT($,.RADIAN.)
);
#157=(
NAMED_UNIT(*)
SI_UNIT($,.STERADIAN.)
SOLID_ANGLE_UNIT()
);
#158=SHAPE_DEFINITION_REPRESENTATION(#159,#160);
#159=PRODUCT_DEFINITION_SHAPE('',$,#162);
#160=SHAPE_REPRESENTATION('',(#92),#149);
#161=PRODUCT_DEFINITION_CONTEXT('part definition',#166,'design');
#162=PRODUCT_DEFINITION('1000644mill','(Unsaved)',#163,#161);
#163=PRODUCT_DEFINITION_FORMATION('',$,#168);
#164=PRODUCT_RELATED_PRODUCT_CATEGORY('(Unsaved)','(Unsaved)',(#168));
#165=APPLICATION_PROTOCOL_DEFINITION('international standard',
'automotive_design',2009,#166);
#166=APPLICATION_CONTEXT(
'Core Data for Automotive Mechanical Design Process');
#167=PRODUCT_CONTEXT('part definition',#166,'mechanical');
#168=PRODUCT('1000644mill','(Unsaved)',$,(#167));
#169=PRESENTATION_STYLE_ASSIGNMENT((#171));
#170=PRESENTATION_STYLE_ASSIGNMENT((#172));
#171=SURFACE_STYLE_USAGE(.BOTH.,#173);
#172=SURFACE_STYLE_USAGE(.BOTH.,#174);
#173=SURFACE_SIDE_STYLE('',(#175));
#174=SURFACE_SIDE_STYLE('',(#176));
#175=SURFACE_STYLE_FILL_AREA(#177);
#176=SURFACE_STYLE_FILL_AREA(#178);
#177=FILL_AREA_STYLE('Steel - Satin',(#179));
#178=FILL_AREA_STYLE('Opaque(160,160,160)',(#180));
#179=FILL_AREA_STYLE_COLOUR('Steel - Satin',#181);
#180=FILL_AREA_STYLE_COLOUR('Opaque(160,160,160)',#182);
#181=COLOUR_RGB('Steel - Satin',0.627450980392157,0.627450980392157,0.627450980392157);
#182=COLOUR_RGB('Opaque(160,160,160)',0.627450980392157,0.627450980392157,
0.627450980392157);
ENDSEC;
END-ISO-10303-21;

0 comments on commit 29b7591

Please sign in to comment.