[Wa...] Posted August 21, 2021 Share Posted August 21, 2021 I want to build a point matix based on the center point. x direction length 2mm, y direction lenth 8mm, the Interval equals to 0.2mm. Now I used is the for-loop method. But it is time consuming,about 3minutes. The question is how to creat the point matix more quickly? t1=0.2 t2=0.2 for i in range(1,12): for j in range(1,42): MCAD_ELEMENT = gom.script.primitive.create_surface_point( name=str(i-6) + ' ' + str(j), point={'interpolated': True, 'normal': gom.Vec3d(0.00000000e+00, 0.00000000e+00, 1.00000000e+00), 'point': gom.Vec3d(x - (i -6)* t2, y - (j - 21) * t1, z), 'target': gom.app.project.actual_elements['曲面成分 1']}) Link to comment Share on other sites More sharing options...
[Wa...] Posted August 26, 2021 Author Share Posted August 26, 2021 Hello, Gom team, Recent days, i test the gom function( "MCAD_ELEMENT = gom.script.primitive.create_surface_point' )'s efficiency. The result shows it is time consuming and not suitable to creat lots of points. Also, i test another gom funtion(MCAD_ELEMENT=gom.script.primitive.create_equidistant_surface_points_evenly). This funtion can creat 300 points in seconds. It is quite fast. However, it need to select the region on the surface which cannot be precisely define the length and width. Moveover, it is equal distance in x and y direciton. The amount of point and the sequence cannot be decided. Does anyone has better solution? left in pic use equidistant method. right in pic use for loop method with creat surface point. Link to comment Share on other sites More sharing options...
[Ch...] Posted August 26, 2021 Share Posted August 26, 2021 My guess is that the thing that is slow is the scripting dialog. Do you have the script dialog open? Can you try to run the script from the menu without opening the script dialog? Link to comment Share on other sites More sharing options...
[Wa...] Posted August 27, 2021 Author Share Posted August 27, 2021 Please sign in to view this quote. I tried both,there is no big difference. Thanks in advance. 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