## Reply To: Wallniche in curved Walls

Home Forums Problems and solutions in GDL Doors and windows Wallniche in curved Walls Reply To: Wallniche in curved Walls

#18321
Péter Baksa
Keymaster

Hi Joachim,

Yes, it is possible. ROTX -90, then cut with a crescent-shaped polygon.
For example, this cuts a niche when placed properly (you’d have to handle left and right curved walls, and flipped/mirrored state too):

``````hotspot 0,0,0
rotx -90

_wallRadius		= sqr(WIDO_ORIG_DIST **2 + A **2 / 4)

dict _arcCenter
_arcCenter.x		= 0
_arcCenter.y		= -WIDO_ORIG_DIST

! surface of wall
dict _faceCircle
_faceCircle.center	= _arcCenter

! chord at window plane
dict _chord
_chord.points[1].x = -A/2
_chord.points[1].y = 0.0
_chord.points[2].x = A/2
_chord.points[2].y = 0.0

! project points of chord to _faceCircle, from _arcCenter centrally
dict _faceArc
call "BasicGeometry" parameters iFunction	= 18,		! BasicGeometry.PROJECT_POINTS_CIRCLE_2D
points2D	= _chord,
pointFrom	= _arcCenter,
circleA		= _faceCircle,
returned_parameters	_faceArc! should have exactly 1 intersection

hotspot _arcCenter.x,		_arcCenter.y,		0
hotspot _faceArc.points[1].x,	_faceArc.points[1].y,	0
hotspot _chord.points[1].x,	_chord.points[1].y,	0
hotspot _faceArc.points[2].x,	_faceArc.points[2].y,	0
hotspot _chord.points[2].x,	_chord.points[2].y,	0

put _arcCenter.x,		_arcCenter.y + _wallRadius,		1+4+8+16+64
put _arcCenter.x,		_arcCenter.y,				931
put _chord.points[1].x,		_chord.points[1].y,			3031
put _faceArc.points[1].x,	_faceArc.points[1].y,			31
put _arcCenter.x,		_arcCenter.y + _faceCircle.radius,	0

resol WALL_RESOL

wallniche	NSP / 3, 1, 2,							! n, method, status
0, 0, 1,							! rx, ry, rz
B,								! d
use(NSP)							! x, y, s
mulx -1
wallniche	NSP / 3, 1, 2,							! n, method, status
0, 0, 1,							! rx, ry, rz
B,								! d
get(NSP)							! x, y, s
del 1``````

Péter Baksa
Library Platform, Software Engineer
GRAPHISOFT SE