Jump to content

Changing in automatic script point from pre alignment


---
 Share

Recommended Posts

gom.script.sys.edit_creation_parameters (element=gom.app.project.alignments['Prealignment'])
 
gom.script.sys.edit_creation_parameters (
    actual_point_1={'interpolated': True, 'normal': gom.Vec3d (0.3390497863, 0.9389895797, -0.05782522634), 'point': gom.Vec3d (16.2586519, -1.642760776, 6.281157939), 'target': gom.app.project.parts['Part'].actual},
    element=gom.app.project.alignments['Prealignment'],
    nominal_point_1={'interpolated': True, 'normal': gom.Vec3d (-1.0, 0.0, 0.0), 'point': gom.Vec3d (-0.8499999983, -0.01679463386, -0.3046244892), 'target': gom.app.project.parts['Part'].nominal})
 
gom.script.manage_alignment.set_alignment_active (cad_alignment=gom.app.project.alignments['Prealignment'])
 
 I'd like to change the point (which is in red at the top here) in my script. Because the scans are not always in the same place when they are loaded into the gom inspect software.
The question is how can I change this.
Now I can't do this
 
 
Edited
Link to comment
Share on other sites

Hi Marc, 
Not sure if this will help or not, but have you explored using a nominal and actual point for the pre-alignment help point? 

Then maybe just change the actual point through your script somehow? 

Without more context its hard to recommend  the best approach, but hope this helps. 
image.thumb.png.e7aafc216808f6c4e1f639a338c6c2f7.png

Link to comment
Share on other sites

sorry after re-reading your post, it seems like this is what you are doing, but just trying to edit the actual point through your script? 

How do you plan to create this actual point through your script? Please add more context so we can help!

Link to comment
Share on other sites

i would be looking for solutions where this help point is not required .  Working in this way kind of negates the architecture of parametrics and having the stable alignment structure in the project template rather than creating on the fly.   Im assuming rotational.symmetry or large discrepencies between actual and nominal , but there will likely be a better solution than coding to acheive your end goal.

As stated , more context , images etc will help understand . 

Link to comment
Share on other sites

This is the CAD model

image.png.6e81d4695c08e3d6ba301e7f5ba1923d.png

The scan part

image.png.d4904286cd41472bd37d2dd96b833375.png

if i do pre-alignment the part turns 180° it's not always correct.

Bad pre-alignment

image.png.863301465e83ec8fe37a6af2203bad1d.png

 

Good pre-alignment

image.png.98861787971ea8b1cabf2576a18c1dd7.png

The problem is that no scan is on the same place.
I do this with scripting there are to many parts.
 If i do it with point next scan part is the point in the pre alignment not correct so he must first turn 180 degrees .

 

Link to comment
Share on other sites

Few ideas 

1. What happens if you change the search to 'long' ? Is this more stable in finding correct orientation ?

2. If you split out the central feature that has more unique geometry into a seperate part , try to pre align to this ( can target another part ) 

3. Similar to 2 but after making a correction to alignment of any mesh , take a copy , import as a nominal model and align to this. Maybe cutting out the central piece might work out better 

Failing this id look into methods to control the start point of the scan , for example via a reference frame . There are combinations with the methods above where reference point cloud can be used to control an orientation at the scanning stage .

 

Link to comment
Share on other sites

1 2 3 doesn't work

Failing this id look into methods to control the start point of the scan , for example via a reference frame . There are combinations with the methods above where reference point cloud can be used to control an orientation at the scanning stage . How do you do this?

Link to comment
Share on other sites

Hello,

here is a techguide article for the alignment with reference points: ZEISS Quality Tech Guide

Another idea could be the cutout at the Z+ end of the part, which could be used for an alignment by geometry elements though. A nominal surface point (intersection with mesh) at this position will intersect the mesh no matter if the part is "flipped" 180° or not. An alignment with a cylinder with Z-axis, plane with Z normal and the point as third element should align the cutout correctly. It will not be 100% perfect but you can use this alignment as a starting point. (The actual surface point should have alignment required active)

image.png.a0785cebca5ccbb0eefaff08adee3ef0.png

Link to comment
Share on other sites

Nice idea nanno, but i think part of the issue here is that there is no stable start alignment in which to pick up these geometries from in order to lock to the target.

Here is an off the wall idea involving code building on this concept ....

Create the geometries as suggested and make a prealignment .

Create an alignment using plane described and cylinder that will be picked up and any surface point random point 

In code evaluate the dn of the value in the pocket.  If greater than a certain value , say half the height of the pocket it would be reasonable to assume the part is 180 degrees out of rotation .

Create a further alignment flipped by 180, locking to the cylinder axis 

Mesh can be exported , then brought into project template with starting alignment as original alignment , then jump directly to the geometrical alignment described.

A bit long winded and unconventional but maybe might give you some possibilities! 

Edited
Link to comment
Share on other sites

I would use target surfaces. From my experience less is more, and sometimes I've spent 10 hours on finding the correct surfaces to click as a target surface.

Below you can see I am selecting a unique key cutter on one cylinder so they don't get confused and a nice large plane to level on.

One you create the nominal surface, you apply a 'no measuring principle' to it. Here is the secret sauce, there is a bug in the software. If you have a mesh loaded in your program and try to create a 'prealignment' then inside the prealignment select the 'target element' checkbox and use this surface you created the program will error out and not let the part align.

The workaround for this bug is to delete the mesh and do this prealignment without a mesh. Then you will get a yellow error message but it will allow you to create the prealignment...then you bring in your mesh and it will work. I suggest using long for these most of the time, but play with short, medium and long, and play with the surfaces you think are unique and at least one robust surface.

 

 

PREALIGN_TARGET_SURFACE.jpg

fafa.jpg

Edited
Link to comment
Share on other sites

Assuming you always scan the part in a similar way:

  1.  Throw some targets down on the plate you use to scan the part.
  2.  Make a rough outline of the part w a pencil
  3. Scan & manually align the part with the help point so it aligns correctly.
  4. export the reference points that you placed on the table as a refxml.
  5. import those back into the project as a nominal pt cloud / component.
  6. replace the initial alignment with a best fit by reference pt alignment
  7. from here you have a few options
    1. subsequent local best fit with large search radius
    2. create help point using touch pt disc & large offset & radius
      1. use that as the help pt for your prealignment.
    3. etc
  8. save as template
  9. just make sure to scan the part in the same starting position & orientation with respect to those dots you placed on the table. (eg. #2)

 

hope it helps.

Link to comment
Share on other sites

 Share

×
×
  • Create New...