IconObject[{base1_,base2_},pts0_,r_]:=With[{base={base1,base2}},With[{pts=If[UnsameQ@@Quotient[2+#[[2]]&/@pts0,3],First/@pts0,With[{pos=Quotient[2+#[[2]]&/@pts0,3]/.{{x_,x_,x_}{1,2,3},{x_,x_,_}{1,2,0},{x_,_,x_}{1,0,2},{_,x_,x_}{0,1,2}}},If[(Cases[Last/@pts0,_Integer,1,1][[1]])(Select[Split[Sort[Cases[Quotient[2+#[[2]]&/@pts0,3],_Integer,1]]],Length[#]>1&][[1,1]]),With[{pt=pts0[[Position[pos,0][[1,1]],1]]},Map[repositionmultiples[base,pt,#.1]&,pos/.{2-1}]],With[{cors=If[Cases[Last/@pts0,_Integer,1,1][[1]]>Select[Split[Sort[Cases[Quotient[2+#[[2]]&/@pts0,3],_Integer,1]]],Length[#]>1&][[1,1]],pos,pos/.MapIndexed[##2[[1]]&,Reverse[Ordering[Mod[2+#[[2]]&/@pts0,3][[Flatten[Position[pos,1|2|3]]]]]]]]},MapIndexed[If[MatchQ[cors[[#2[[1]]]],0|2],#,repositionmultiples[base,#,Sign[cors[[#2[[1]]]]-2].1]]&,First/@pts0]]]]]},With[{uvecs=iconpoints3[Function[p,If[pbase,{1,0},(p-base)/Norm[p-base]]]/@pts]},With[{mids=MapThread[Plus,{uvecs,RotateLeft[uvecs]},1]/2},Table[{{Red,Green,Blue}[[i]],Polygon[{base,Offset[rmids[[i]],base],Offset[ruvecs[[i]],base],Offset[rmids[[Mod[i-1,3,1]]],base]}]},{i,3}]]]]]