Goodmorning, how can I do the 2D view like sketch ? I have tried view 1A with POLY2 4,1+4+1024,.... or with POLY2 4,1+4+512,... and display it's correct only I see the outline of POLY2. It's possible no display the outline of POLY2? Or exist another method for this type of display? Thank you.
- Forum
- CAD Parametrische Modellierung
- CAD SmartParts
[Frage] View 2D stair smartpart
Examine the SmartPart. There is the section representation calculatetd with simple tangens!
I am not your coding servant! Either you are able to write something like this yourself, or just leave it!
Anhänge (2)
Thank you very much Nemo for your help, your code it's very good!
Now i try to understand how it works so i try to learn. Thank you , goodbye!
I am not your coding servant! Either you are able to write something like this yourself, or just leave it!
Hi Nemo, one question sorry...why do you see the points (look red arrow)?
Anhänge (1)
Quotato da:
Nemo
Examine the SmartPart. There is the section representation calculatetd with simple tangens!
I am not your coding servant! Either you are able to write something like this yourself, or just leave it!
Hi Nemo, one question sorry...why do you see the points (look red arrow)?
I have tried and it seems to me that these two fixes solve the problem (look code with written !!!correction).
In your opinion it's Ok this correction? Goodbye
TRANS2 0 , -wdt / 2
IF cut THEN
STROKE str_bot
id = 0
HANDLE2 0 , 0 , id , "cut_pos" , 1
HANDLE2 cut_pos , 0 , id , "cut_pos" , 2
HANDLE2 -1 , 0 , id , "cut_pos" , 3
id = id + 1
IF cut_bot THEN
!run line bottom
xe = cut_pos - cut_off / 2
LINE2 0 , 0 , xe , 0
LINE2 xe , 0 , xe - arr_sz , -arr_sz
LINE2 xe , 0 , xe - arr_sz , arr_sz
!cutting line bottom
xl = cut_pos - cut_off / 2 - TAN ( cut_ang ) * wdt / 2
xr = cut_pos - cut_off / 2 + TAN ( cut_ang ) * wdt / 2
LINE2 xl , wdt / 2 , xr , -wdt / 2
!border line left
LINE2 0 , wdt / 2 , xl , wdt / 2
!border line right
LINE2 0 , -wdt / 2 , xr , -wdt / 2
x = 0
FOR n = 1 TO stps + 1
!cut point
ye = MAX ( -wdt / 2 , MIN ( wdt / 2 , ( cut_pos - cut_off / 2 - x ) / TAN ( cut_ang ) ) )
! IF ye >= -wdt / 2 THEN
IF ye > -wdt / 2 THEN !!!!!!correction
LINE2 x , -wdt / 2 , x , ye
ENDIF
x = x + stp
NEXT n
ENDIF
IF cut_top THEN
STROKE str_top
!run line top
xs = cut_pos + cut_off / 2
LINE2 xs , 0 , stps * stp , 0
LINE2 stps * stp , 0 , stps * stp - arr_sz , -arr_sz
LINE2 stps * stp , 0 , stps * stp - arr_sz , arr_sz
!cutting line top
xl = cut_pos + cut_off / 2 - TAN ( cut_ang ) * wdt / 2
xr = cut_pos + cut_off / 2 + TAN ( cut_ang ) * wdt / 2
LINE2 xl , wdt / 2 , xr , -wdt / 2
!border line left
LINE2 xl , wdt / 2 , stps * stp , wdt / 2
!border line right
LINE2 xr , -wdt / 2 , stps * stp , -wdt / 2
x = 0
FOR n = 1 TO stps + 1
!cut point
ye = MAX ( -wdt / 2 , MIN ( wdt / 2 , ( cut_pos + cut_off / 2 - x ) / TAN ( cut_ang ) ) )
! IF ye >= -wdt / 2 THEN
IF ye < wdt / 2 THEN !!!!correction
LINE2 x , wdt / 2 , x , ye
ENDIF
x = x + stp
NEXT n
RECT2 stps * stp , wdt / 2 , stps * stp + ext_end , -wdt / 2
ENDIF
ELSE
RECT2 0 , wdt / 2 , stps * stp , -wdt / 2
x = 0
FOR n = 1 TO stps + 1
LINE2 x , wdt / 2 , x , -wdt / 2
x = x + stp
NEXT n
RECT2 stps * stp , wdt / 2 , stps * stp + ext_end , -wdt / 2
ENDIF
RESTORE 1