[Jo...] Posted January 7, 2022 Share Posted January 7, 2022 Hello everybody, I'm trying to build a script for 2D traitement on lot of data. My problem is regarding the select_through_surface fonction when I want to have a virtual strain gage. Sometimes, the selection is not accurate and give bad result although I'm sure of the value indicated. When I change the coordinate of some points it can work again. As I want to do lot of data, I don't want to check every project. Does anyone have encountered this problem? Is there any tip to avoid that ? gom.script.selection3d.select_through_surface ( coordinates=[gom.Vec3d (-taille_jauge_axiale[1]/2, taille_jauge_axiale[0]/2, 0), gom.Vec3d (taille_jauge_axiale[1]/2, taille_jauge_axiale[0]/2, 0), gom.Vec3d (taille_jauge_axiale[1]/2, -taille_jauge_axiale[0]/2, 0), gom.Vec3d (-taille_jauge_axiale[1]/2, -taille_jauge_axiale[0]/2, 0)], view_direction=gom.Vec3d (0.0, 0.0, 1.0), view_origin=gom.Vec3d (0.0, 0.0, 0)) Thanks, Joseph Link to comment Share on other sites More sharing options...
[Jo...] Posted February 1, 2022 Author Share Posted February 1, 2022 Hello, it seems the problem wasn't in the "selection through surface" but in the arithmetical mean. The trick (given by Tom Guilloux) is to use "deformation create surface component region" and then it works wonderfully. gom.script.selection3d.select_through_surface ( coordinates=[gom.Vec3d (-a, b, 0), gom.Vec3d (a, b, 0), gom.Vec3d (a, -b, 0), gom.Vec3d (-a, -b, 0)], view_direction=gom.Vec3d (5.393091386e-15, 1.198464799e-15, 1.0), view_origin=gom.Vec3d (-0.2397382408, 8.746335497e-14, 74.99372864)) MCAD_ELEMENT=gom.script.deformation.create_surface_component_region ( name='Zone jauge virtuelle axiale', properties=gom.Binary ('ie9aN1dPfT7Qto0PM/RIgKpgFeIQ==')) MCAD_ELEMENT=gom.script.inspection.inspect_dimension ( elements=[gom.app.project.actual_elements['Zone jauge virtuelle axiale']], name='jauge_axiale', nominal_value=0.0, nominal_value_source='fixed_value', properties=gom.Binary ('eAHtmm2MnFwA0w+sWAYmP'), type='epsilon_y') Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in