cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Axis visibility in a drawing view

Ketan_Lalcheta
19-Tanzanite

Axis visibility in a drawing view

Hello

 

Let me give you some hint of what need to be achieved for Axis visibility in drawing view.

 

Consider a simple part and it has three planes A, B and C. These planes are parallel to front, top and side plane of model.Now if a view is created for this part into drawing, only two panes are visible. This can be identified as below:

 * consider view transformation matrix (Tv)

* consider sheet transformation matrix (Ts)

* consider a vector representing normal to plane (Vp) . This can be achieved getting geomdata of surface (plane is surface only) and finding its normal from geom data

* Transfer Vp with respect to Tv

* Transfer modified Vp into last step with respect to Ts and  call this vector as Final Vp i.e. FVp

* z axis is vector is 0,0,1 and multiply this Z axis vector to FVp so that we can get dot product of two vectors. If product is zero plane would be visible into view. 

 

Similar logic is required for Axis to be visible into view or not. Confusion is that how to find normal of axis like normal to plane we did for the case of plane.

 

Any idea is of great help.

 

Thanks in advance.

 

Regards

Ketan

 

 

 

4 REPLIES 4

If you transform the axis into the view matrix, the vector length should be ALMOST_ZERO.

FV
17-Peridot
17-Peridot
(To:Ketan_Lalcheta)

ProAxis  to ProGeomitemdata  to ProCurvedata to ProLinedata

ProLinedata has two ProPoint3d end2 and end1. 

V = (end2 - end1)/LENGTH(end2-end1) - this is line-unit-vector ( normals for  a line from a point on a line would form a plane which this line intersects at that given point).

if the absolute value of the dot product of a line unit vector translated into view coordinates with the view z vector is double-equal to 1.0+/-fuzz  - the axis is a cross-line symbol,  if anything else (fabs(d) < 0.95), the axis will be represented as a line, if dot-product is close to 0 the axis will be in a view plane.   

Ketan_Lalcheta
19-Tanzanite
(To:FV)

Fabulous response... Was looking for something like this....

Dot product of unit vector value with View z vector almost 1 and almost zero represent cross visibility and no visibility of axis in view.... Something what I don't understand is line representation of axis in a view for dot product value around 0.95...

Many more helpful response... I was also trying something and about to achieve... Will post my logic also once I will finalize but do let me know importance of .95 value

For a view, two planes will be visible and identified already using normal of plane i.e. surface.

 

Now for axis, find Surface using ProAxisSurfaceGet(). Get surface geom data and find two planes direction e1 and e2 as two different vectors (data.p_surface_data->srf_shape.plane.e1 & data.p_surface_data->srf_shape.plane.e2)

 

Now take first vector as normal to plane 1 and find its cross product with e1 vector first and then with e2 vector.... If any one of the two cross product is zero, at least one AXIS line will be visible into view.

 

Now take first vector as normal to plane 2 and find its cross product with e1 vector first and then with e2 vector.... If any one of the two cross product is zero, another AXIS line will be visible into view.

 

Is this logic bug free or do you see any loop holes into this?

 

I am yet to dig down into it and seems one issue is observed for specific input (issue might not be due to the above logic but not sure). Any comment or suggestion on my implemented logic would be of great help..

 

 

Announcements


Top Tags