ladybug-tools/honeybee-legacy

glazingCreator with Rhino 6

Closed this issue · 7 comments

Hi,
I just get this issue that was getting me crazy. Checking a parametric window i'm getting the same results from some window size on.
Investigating further in the model (a simple box) i noticed that from some window size the window is eliminated in the HB_createHBZones, even though the HB_glazingCreator is showing it as expected.
This is happening with R6 and working fine in R5.
For this example the size works for the 15 and 30% but doesn't for 45 and bigger (according to the slider i defined).
Attached the file and i believe this is a pretty much weird bug. Isn't it?

Thanks,
-A.

ParametricWindowProblem.zip

Looking at the editor of the component it writes:

A very tiny glazing is removed from zone_0_Srf_4.

Hope this helps as hint to where to locate the problem.
-A.

@ayezioro ,
I can't check your file right now but this warning can sometimes happen if your Rhino model units are different. Are the unit systems and tolerances that you are using in Rhino 5 and Rhino 6 the same? If so, then you are right that this is probably a bug and I will have a look soon.

Hi @chriswmackey,
Yes the units are the same for R5 R6: meters. Tolerance too: 0.001.
The weird thing is that some window sizes are fine.

I can say also that tried to define windows on the 4 facades (of the box), thinking that maybe it can be related to some orientation. The result was that only 2 facades showed the window and the other 2 doesn't.

Thanks,
-A.

Hi,
Wanted to report that the issue is expanding to other components: HB_createHBZones.
I have one surface with a large window on it. After plugging it into the component the window disappeared. The print in the editor reports the same as i wrote before (Tiny window).
-A.

Hi again,
Trying to identify where this issue is happening i get to the following section in the HB_HB component (starting at line 6802):

        for glzSrf in self.childSrfs:
            glzEdges = glzSrf.geometry.DuplicateEdgeCurves(True)
            jGlzCrv = rc.Geometry.Curve.JoinCurves(glzEdges)[0]
            # in some cases glazing based on percentage generates very small glazings
            # here I check and remove them
            
            # check area of curve
            try:
                if self.isPlanar:
                    area = rc.Geometry.AreaMassProperties.Compute(jGlzCrv).Area *sc.sticky["honeybee_ConversionFactor"]*sc.sticky["honeybee_ConversionFactor"]
                    print '1 ', area
                else:
                    area = rc.Geometry.AreaMassProperties.Compute(glzSrf.geometry).Area *sc.sticky["honeybee_ConversionFactor"]*sc.sticky["honeybee_ConversionFactor"]
            except:
                # in case area calulation fails
                # let it go anyways!
                area = 10 * sc.doc.ModelAbsoluteTolerance
            
            #if  area > sc.doc.ModelAbsoluteTolerance and checkCrvsPts(jGlzCrv):
            if  abs(area) > sc.doc.ModelAbsoluteTolerance and checkCrvsPts(jGlzCrv):

Somehow at line 6811 the calculated area is negative for some cases, and as a result, the window is omitted.
I assume that jGlzCrv is creating a reversed curve, then the negative calculation.
For now i added the absolute value of the area as a temporary solution, but i believe a smarter solution is in order.
Hope this helps for debugging.
-A.

@ayezioro ,
Thanks for getting to the bottom of this and I apologize for the incredibly late reply. Negative areas really seem like a major bug in Rhino SDK and I hope that McNeil fixes it soon. We need to let them know about this since a bug this large can really wreck havoc on a lot of stuff. In the meantime, I have added a patch here and this has addressed, using the absolute value as you suggest:
920ddf5
For now I am going to close out this issue but I'll try to find the relavant place to post this on McNeil's forums

Thanks @chris,
Those kind of things that can make you crazy since you don't expect they can happen.
Rely on you to report McNeel.
-A.