cancel
Showing results for 
Search instead for 
Did you mean: 

3D Solid Model does not rotate

Pioneer
Pioneer

Hi!

 

I am writing a UI Block Styler journal, a part of which involves rotating the selected "body" by user defined angles about X and Y axis. The problem is, the function I am using for rotation works fine for rotating one of the CAD models that I have, and not for some of the other ones that I made. I am not sure the reason for this, but it looks like it is something to do with constraining/ coordinate system definition with the part. I am posting the part of the code which handles rotation:

void rotate_objects(double x_ang,double y_ang,tag_t body_tag,int order)
			{	    
					int	one = 1,n=1,resp,two = 2,zero = 0;
					tag_t *objects,mx,wcs;
					double	angle1 = x_ang,angle2 = y_ang,origin[3],rotation[12],wcs_vectors[9];	
					UF_CALL(UF_CSYS_ask_wcs(&wcs));
					UF_CALL(UF_CSYS_ask_csys_info(wcs, &mx, origin));
					UF_CALL(UF_CSYS_ask_matrix_values(mx, wcs_vectors));
					double X_axis[3];
					X_axis[0]=wcs_vectors[0];
					X_axis[1]=wcs_vectors[1];
					X_axis[2]=wcs_vectors[2];
					double Y_axis[3];
					Y_axis[0]=wcs_vectors[3];
					Y_axis[1]=wcs_vectors[4];
					Y_axis[2]=wcs_vectors[5];
					double Z_axis[3];
					Z_axis[0]=wcs_vectors[6];
					Z_axis[1]=wcs_vectors[7];
					Z_axis[2]=wcs_vectors[8];
 
			if (order==1)
				{
					FTN(uf5945)(origin, X_axis, &angle1, rotation, &resp);
					FTN(uf5947)(rotation, &body_tag, &n, &one,&zero,&two,NULL,NULL,&resp);
					FTN(uf5945)(origin, Y_axis, &angle2, rotation, &resp);
					FTN(uf5947)(rotation, &body_tag, &n, &one,&zero,&two,NULL,NULL,&resp);
				}
			else if (order==2)
				{
					FTN(uf5945)(origin, Y_axis, &angle2, rotation, &resp);
					FTN(uf5947)(rotation, &body_tag, &n, &one,&zero,&two,NULL,NULL,&resp);
					FTN(uf5945)(origin, X_axis, &angle1, rotation, &resp);
					FTN(uf5947)(rotation, &body_tag, &n, &one,&zero,&two,NULL,NULL,&resp);
				}
			}

In the attached zip folder, the part simpleblocks2345.prt, does not rotate if this function is called whereas the part i_t_2_sldprt.prt rotates. I have attached .prt files for both parts for your reference. Please share your suggestions as to what I am missing here.

4 REPLIES

Re: 3D Solid Model does not rotate

Esteemed Contributor
Esteemed Contributor

In most cases parametrized bodies can't be rotated, due to associativity.

The sldprt.prt seems to be an imported part, which has no parameters, so it is easy to rotate it.

 

What exactly do you want to use the rotation for, explain in detail.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX12.0

How to Get the Most from Your Signature in the Community

Re: 3D Solid Model does not rotate

Pioneer
Pioneer

Okay, then how should I process the CAD model to allow it to rotate? 

I need to rotate it, so that user can give an orientation at which the supports requirement can be analysed for Additive Manufacturing at that orientation. At the given orientation I evaluate the facets  normal vector that exceed the threshold and  calcualte the area of all such faces that will be in contact with the support. 

Also, I use the rotation to calculate the hatching area or sintering area of each layer, at the given orientation of the part along with the support structures at that orientation, during the AM process.

Re: 3D Solid Model does not rotate

Honored Contributor
Honored Contributor

I'd suggest creating a new assembly file and adding your part as a component. This way you can freely rotate the model in the assembly space.

Re: 3D Solid Model does not rotate

Esteemed Contributor
Esteemed Contributor

How about only rotating the view and not the object?

This way there is no change to the geometry and you can still use the screen plane direction as the projection vector.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX12.0

How to Get the Most from Your Signature in the Community