Direction of Normal

Bug 1

Undesired Outcome Intended Outcome
Returns The bottom side of the entity cannot be extruded.

Direction of Normal - Bug 1 - Undesired - Return.png
An extrusion is created on every side of the entity.

Direction of Normal - Bug 1 - Intended - Return.png
Procedures
Direction of Normal - Bug 1 - Undesired - Procedures.png

Direction of Normal - Bug 1 - Intended - Procedures.png
Explanations Bug occured as the pgon created in the 2nd line of code is facing the positive Z direction. As seen in the image below, the polygon has its front(white) surface facing up and back(gray) surface facing down.

Direction of Normal - Bug 1 - Undesired - Explanations.png
As such, the normal of pgon along which the extrusion will take place is pointing in the positive Z direction. Thus, pgon is extruded upwards and the extruded polygons are hidden from sight by the other polygons.
Debug by reversing the surface of the pgon created in the 2nd line of code. This will allow the surface to be facing downwards and the extrusion of the polygon will be in the negative Z direction.


Bug 2

Undesired Outcome Intended Outcome
Returns Rectangular pattern generated is of the surface of the polygon.

Direction of Normal - Bug 2 - Undesired - Return.png
A rectangular pattern is created on the surface of a polygon.

Direction of Normal - Bug 2 - Intended - Return.png
Procedures
Direction of Normal - Bug 1 - Undesired - Procedures.png

Direction of Normal - Bug 2 - Intended - Procedures.png
Explanations Bug occurred because the user did not realise that if the normal of the entity is not provided, the function will assume that the entity created is facing the Z direction.

In the case of this example, cen in the function pattern.Rectangle is a coordinate on ex[0] and does not provide the normal of the pattern, hence the pattern created is facing the Z direction.
Debug by using the function virtual.GetPlane which returns both the coordinates of the centroid and the normal of ex[0]. Inputting pln into pattern.Rectangle will enable the pattern to be created facing the intended direction.

results matching ""

    No results matching ""