Skip to main content
deleted 18 characters in body
Source Link
Henrik Schumacher
  • 112.9k
  • 7
  • 197
  • 339

I am not sure but I think it does what you ask for. I just create a constant list lineweights of weights for the lines. (I would discourage storing the weight within the Line object in any way.)

lines = LineFlatten[Table[Line[{{0, /@i}, Partition[N[pts]{8, 2];j}}], {i, 1, 8}, {j, 1, 8}]]; lineweights = ConstantArray[1., Length[lines]]; rectangles =  Flatten[Outer[ Rectangle @@ Transpose[List[##]] &, Partition[N[lver[[All, 1, 1, 1]]], 2, 1], Partition[lho[[All, 1, 1, 2]], 2, 1], 1 ]]; A = 1 - Outer[ Boole@*RegionDisjoint, DiscretizeRegion /@ lines, rectangles ]; means = Mean[lineweights A]A]; Show[ Graphics[Transpose[{GrayLevel /@ Rescale[1 - means], rectangles}]], Graphics[{Darker@Blue, lines}] ] 

enter image description here

I am not sure but I think it does what you ask for. I just create a constant list lineweights of weights for the lines. (I would discourage storing the weight within the Line object in any way.)

lines = Line /@ Partition[N[pts], 2]; lineweights = ConstantArray[1., Length[lines]]; rectangles =  Flatten[Outer[ Rectangle @@ Transpose[List[##]] &, Partition[N[lver[[All, 1, 1, 1]]], 2, 1], Partition[lho[[All, 1, 1, 2]], 2, 1], 1 ]]; A = 1 - Outer[ Boole@*RegionDisjoint, DiscretizeRegion /@ lines, rectangles ]; means = Mean[lineweights A] 

I am not sure but I think it does what you ask for. I just create a constant list lineweights of weights for the lines. (I would discourage storing the weight within the Line object in any way.)

lines = Flatten[Table[Line[{{0, i}, {8, j}}], {i, 1, 8}, {j, 1, 8}]]; lineweights = ConstantArray[1., Length[lines]]; rectangles = Flatten[Outer[ Rectangle @@ Transpose[List[##]] &, Partition[N[lver[[All, 1, 1, 1]]], 2, 1], Partition[lho[[All, 1, 1, 2]], 2, 1], 1 ]]; A = 1 - Outer[ Boole@*RegionDisjoint, DiscretizeRegion /@ lines, rectangles ]; means = Mean[lineweights A]; Show[ Graphics[Transpose[{GrayLevel /@ Rescale[1 - means], rectangles}]], Graphics[{Darker@Blue, lines}] ] 

enter image description here

deleted 18 characters in body
Source Link
Henrik Schumacher
  • 112.9k
  • 7
  • 197
  • 339

I am not sure but I think it does what you ask for. I just create a randomconstant list lineweights of weights for each linethe lines. (I would discourage storing the weight within the Line object in any way.)

lines = DiscretizeRegion@*LineLine /@ Partition[N[pts], 2]; lineweights = RandomReal[{0, 10}ConstantArray[1., Length[lines]]; rectangles =  Flatten[Outer[ Rectangle @@ Transpose[List[##]] &,  Partition[N[lver[[All, 1, 1, 1]]], 2, 1],  Partition[lho[[All, 1, 1, 2]], 2, 1],  1]];1 ]]; A = 1 - Outer[   Boole@*RegionDisjoint,  DiscretizeRegion /@ lines,      rectangles   ]; // AbsoluteTiming means = Mean[lineweights A] 

I am not sure but I think it does what you ask for. I just create a random list lineweights of weights for each line. (I would discourage storing the weight within the Line object in any way.)

lines = DiscretizeRegion@*Line /@ Partition[N[pts], 2]; lineweights = RandomReal[{0, 10}, Length[lines]]; rectangles = Flatten[Outer[ Rectangle @@ Transpose[List[##]] &, Partition[N[lver[[All, 1, 1, 1]]], 2, 1], Partition[lho[[All, 1, 1, 2]], 2, 1], 1]]; A = 1 - Outer[   Boole@*RegionDisjoint, lines,   rectangles   ]; // AbsoluteTiming means = Mean[lineweights A] 

I am not sure but I think it does what you ask for. I just create a constant list lineweights of weights for the lines. (I would discourage storing the weight within the Line object in any way.)

lines = Line /@ Partition[N[pts], 2]; lineweights = ConstantArray[1., Length[lines]]; rectangles =  Flatten[Outer[ Rectangle @@ Transpose[List[##]] &,  Partition[N[lver[[All, 1, 1, 1]]], 2, 1],  Partition[lho[[All, 1, 1, 2]], 2, 1],  1 ]]; A = 1 - Outer[ Boole@*RegionDisjoint,  DiscretizeRegion /@ lines,    rectangles ]; means = Mean[lineweights A] 
added 34 characters in body
Source Link
Henrik Schumacher
  • 112.9k
  • 7
  • 197
  • 339

I am not sure but I think it does what you ask for. I just create a random list lineweights of weights for each line. (I would discourage storing the weight within the Line object in any way.)

lines = LineDiscretizeRegion@*Line /@ Partition[N[pts], 2]; lineweights = RandomReal[{0, 10}, Length[lines]]; rectangles = Flatten[Outer[ DiscretizeGraphics@*Graphics@*RectangleRectangle @@ Transpose[List[##]] &, Partition[N[lver[[All, 1, 1, 1]]], 2, 1], Partition[lho[[All, 1, 1, 2]], 2, 1],   1]  ];1]]; A = 1 - Outer[   Boole@*RegionDisjoint,   lines,   rectangles   ]; // AbsoluteTiming means = Mean[lineweights A] 

I am not sure but I think it does what you ask for. I just create a random list lineweights of weights for each line. (I would discourage storing the weight within the Line object in any way.)

lines = Line /@ Partition[N[pts], 2]; lineweights = RandomReal[{0, 10}, Length[lines]]; rectangles = Flatten[Outer[ DiscretizeGraphics@*Graphics@*Rectangle, Partition[N[lver[[All, 1, 1, 1]]], 2, 1], Partition[lho[[All, 1, 1, 2]], 2, 1],   1]  ]; A = 1 - Outer[ Boole@*RegionDisjoint, lines, rectangles ]; Mean[lineweights A] 

I am not sure but I think it does what you ask for. I just create a random list lineweights of weights for each line. (I would discourage storing the weight within the Line object in any way.)

lines = DiscretizeRegion@*Line /@ Partition[N[pts], 2]; lineweights = RandomReal[{0, 10}, Length[lines]]; rectangles = Flatten[Outer[ Rectangle @@ Transpose[List[##]] &, Partition[N[lver[[All, 1, 1, 1]]], 2, 1], Partition[lho[[All, 1, 1, 2]], 2, 1], 1]]; A = 1 - Outer[   Boole@*RegionDisjoint,   lines,   rectangles   ]; // AbsoluteTiming means = Mean[lineweights A] 
deleted 173 characters in body
Source Link
Henrik Schumacher
  • 112.9k
  • 7
  • 197
  • 339
Loading
Source Link
Henrik Schumacher
  • 112.9k
  • 7
  • 197
  • 339
Loading