GDL
About building parametric objects with GDL.

How to achieve clean looking hprism (with minimal lines) in AC26

Jarrod Phillips
Enthusiast

Hello,

 

Does anyone know if it's possible to remove the lines highlighted green whilst maintaining the lines highlighted red in the attached image using the hprism command? See example code below. Any help would be greatly appreciated! Getting frustrated with the cumbersome ways Archicad handles curves generated by geometry in elevation, section and 3D.

 

 

plateWidth = 0.075
plateHeight = 0.120
plateThickness = 0.005
plateCornerRadius = 0.005
gs_mat = 19
_s = 79

rotx 90

hprism_ gs_mat, gs_mat, gs_mat, gs_mat, ! top_material, bottom_material, side_material, hill_material
10, plateThickness, 0, plateThickness, 1, !n, thickness, angle, hill_height, status
	0, 0, _s,
	(plateWidth/2)-plateCornerRadius, 0, _s,
	plateCornerRadius, 90, 2000 + _s,
	(plateWidth/2), plateHeight-plateCornerRadius, _s,
	plateCornerRadius, 90, 2000 + _s,
	-((plateWidth/2)-plateCornerRadius), plateHeight, _s,
	plateCornerRadius, 90, 2000 + _s,
	-(plateWidth/2), plateCornerRadius, _s,
	plateCornerRadius, 90, 2000 + _s,
	0, 0, _s

del 1

 

 

 Cheers,

 

Jarrod


EXAMPLE IMAGE.png
BIM Manager | Graduate of Architecture
Fulton Trotter Architects - Sydney, Australia
Archicad 15 - 27
11 REPLIES 11
runxel
Legend

Had the same issue. Could not find any way to solve this. In the end I gave up and am now living with those wrong lines in one of my elevations.

It's a shame, really.

Lucas Becker | AC 27 on Mac | Graphisoft Insider Panelist | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text | My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»
Barry Kelly
Moderator

I had the exact same issue just last week.

Off the top of my head without Archicad in front of me, I think that is the masking code for the edges.

15 = show all edges

15 + 64 (i.e.79) = show only visible edge of curves.

15 - 1 = hide bottom edge

15 - 4 = hide top edge

 

So I would think you want 15 + 64 - 4 as the mask.

 

The problem is that that will also hide the lines you highlight in red, which as you say you don't want to happen.

So unfortunately, I don't think there is a solution for this.

It is a shame that the 64 mask does not affect the curvature of the hill as well.

 

 

A tip with masks is I always try to write the mask value as ... _s = 1*1 + 2*1 + 4*1 + 8*1 + 16*1 + 32*1 + 64*1

Then you can just change the 1's to 0's to see how each affects the prism.

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Jarrod Phillips
Enthusiast

Thanks @runxel & @Barry Kelly for your assistance. I didn’t think there was a solution, but I thought I would try my luck on the community forums! I guess the only other way to solve this issue would be to generate the same geometry using primitive elements?

BIM Manager | Graduate of Architecture
Fulton Trotter Architects - Sydney, Australia
Archicad 15 - 27
DGSketcher
Legend

You could try the following... it's literally a patch job, but it seems to work at my end.

 

plateWidth = 0.075
plateHeight = 0.120
plateThickness = 0.005
plateCornerRadius = 0.005
gs_mat = 23
pen 1
_s = 1*1 + 2*1 + 4*0 + 8*1 + 64*1

if GLOB_CONTEXT = 2 then _s = 15 + 64*1
if GLOB_CONTEXT = 3 then _s = 11 + 64*1

if GLOB_CONTEXT = 4 then 
	_s = 1 + 2 + 8 + 64*1

	rotx 90

	add plateCornerRadius-plateWidth/2, plateCornerRadius, plateThickness + 0.0001

	s2 = 1

	cprism_ gs_mat, gs_mat, gs_mat,
			5, 0.0001,
			0, 0, s2,
			plateWidth - 2 * plateCornerRadius, 0, s2,
			plateWidth - 2 * plateCornerRadius, plateHeight - 2 * plateCornerRadius, s2,
			0, plateHeight - 2 * plateCornerRadius, s2,
			0, 0, -1
	
	del 2

endif

rotx 90

hprism_ gs_mat, gs_mat, gs_mat, gs_mat, ! top_material, bottom_material, side_material, hill_material
10, plateThickness, 0.000, plateThickness, 1, !n, thickness, angle, hill_height, status
	0, 0, _s,
	(plateWidth/2)-plateCornerRadius, 0, _s,
	plateCornerRadius, 90, 2000 + _s,
	(plateWidth/2), plateHeight-plateCornerRadius, _s,
	plateCornerRadius, 90, 2000 + _s,
	-((plateWidth/2)-plateCornerRadius), plateHeight, _s,
	plateCornerRadius, 90, 2000 + _s,
	-(plateWidth/2), plateCornerRadius, _s,
	plateCornerRadius, 90, 2000 + _s,
	0, 0, -1

del 1

 

Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)

Thanks @DGSketcher ,

I hadn't thought of using a prism above the surface with invisible sides and top/side lines.

 

You can get away with not offsetting the CPRISM by 0.0001 either.

That means a close up view of the side will be correct.

 

BarryKelly_0-1681782514368.png

 

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

Nice! 😎🙌

Lucas Becker | AC 27 on Mac | Graphisoft Insider Panelist | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text | My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»
Jarrod Phillips
Enthusiast

Hi All,

 

Still getting strange shadow artifacts from this solution, I cannot place anything on the front face of the hprism as it hides the lines of the element placed on top. A neat workaround but still not producing the desired result. I think the only solution here is that Graphisoft needs to provide some updated GDL commands!

 

JarrodPhillips_0-1682140765000.png

 

Cheers,

 

Jarrod

BIM Manager | Graduate of Architecture
Fulton Trotter Architects - Sydney, Australia
Archicad 15 - 27
DGSketcher
Legend

I am guessing this is a standard back plate for electrics etc? If it doesn't need to be parametric then it can be created with a Morph using hidden edges. Keep solid edges in the back face then it should display correctly in all environments. You might want to consider the resolution at the corners as everything is faceted.

 

Save the Morph as an Object and you can then cut & paste the resulting Group from the 3D Script into any other objects which can then have sockets & switches added.

 

It's getting beyond my experience, but it may be possible to use the ADDGROUP & SUBGROUP on the backplate in the 3D script to form holes if necessary. 

 

I'm sure there are many ways to form the Morph, I just extruded a block & applied fillets to the corners & then the top face.

 

 

Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)
DGSketcher
Legend

Of course you could possibly take the morph idea a bit further with 3 morph components - Corner, Edge & Centre Plate and use MUL on the components with ADDGROUP to form a parametric plate. 

 

Or even apply ADDGROUP to ELLIPS, TUBE & PRISM, although I'm not sure what will happen to the ELLIPS at the intersection with the TUBE. At least with the Morph option you are in control of the facets.

Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)