@sgmrt · Post #2308 · 04.04.2025 г., 08:09
[EWL] UPDATE: Normal train services are progressively being restored. Free regular bus is available between #Queenstown and #BoonLay. - SMRT
Hashtags
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #164 · 14 окт.
🙄Разминка для ума! Треугольник Серпинского, интересная фигура которую построить достаточно просто. Алгоритм такой: 1. создаём любые 3 точки на плоскости 2. из этих точек случайно выбираем любую, как начальную 3. случайно выбираем любую точку из этих же трёх точек как цель 4. перемещаемся в сторону цели на половину расстояния 5. повторяем бесконечно с пункта 3 Если сделать достаточно много итераций то вырисовывается интересная фигура. Треугольник, в который вписаны более мелкие треугольники. Это самый настоящий фрактал! Я собрал пример построения такой фигуры на базе Qt. 🌎 Код можно посмотреть здесь. С помощью paintEvent я рисую точки по озвученному алгоритму. Каждые 10 секунд либо по клику на виджете строится следующий треугольник. Особенности примера: 🔸 Атрибут Qt.WA_OpaquePaintEvent позволяет сохранить то, что было нарисовано в прошлой итерации. Таким образом мы видим постепенное наполнение точек а не мелькающую одну точку. 🔸QTimer позволяет создавать отложенные вызовы один раз или с повторением через интервал. 🔸QColor.fromHsv() позволяет создать рандомный но предсказуемый цвет с помощью HSV схемы. Не слишком светлый и не слишком тёмный но всегда с разный. Рандомизации подвергается только смещение по цветовому кругу (Hue), яркость (Value) и насыщенность (Saturation) можно контролировать отдельно в своих пределах или оставить статичными. Обычный рандом цвета по RGB не даёт такой предсказуемый результат. 🔸 Каждый новый цикл с новым треугольником предварительно затемняет предыдущие через этот вызов painter.fillRect(rec, QColor(0, 0, 0, 100)) То есть полупрозрачный цвет. Таким образом, чем старше треугольник, тем он темней. Если сделать виджет фулскрин, то у нас получится некий ScreenSaver))) 🔸 Да, я знаю, что рисование в Qt не самый лучший способ сделать этот пример) Скорее всего самый НЕподходящий. Попробуйте сделать тоже самое но другими средствами. #qt#source#tricks
Пребарај: #boonlay
@sgmrt · Post #2308 · 04.04.2025 г., 08:09
[EWL] UPDATE: Normal train services are progressively being restored. Free regular bus is available between #Queenstown and #BoonLay. - SMRT
Hashtags
@sgmrt · Post #2305 · 04.04.2025 г., 07:59
[EWL] UPDATE: Train services are progressively being restored. Free regular bus is available between #Queenstown and #BoonLay. - SMRT
Hashtags
@sgmrt · Post #2059 · 25.09.2024 г., 09:59
[EWL]:UPDATE Due to a power fault, there is no train svc between Jurong East and Buona Vista. Free regular bus & bridging bus services is still available between #BoonLay and #Queenstown. - SMRT
Hashtags
@sgmrt · Post #2046 · 25.09.2024 г., 07:29
[EWL]:UPDATE Due to a power fault, there is no train svc between #BoonLay and #Queenstown. Free regular bus & bridging bus services is still available between #BoonLay and #Queenstown. - SMRT
Hashtags
@sgmrt · Post #2043 · 25.09.2024 г., 06:44
[EWL]:UPDATE Free regular bus & bridging bus services are still available between #BoonLay and #Queenstown. Passengers with special needs, please approach our station staff for assistance. Our staff are attending to the matter. - SMRT
Hashtags
@sgmrt · Post #2042 · 25.09.2024 г., 06:29
[EWL]:UPDATE Due to a power fault, there is no train svc between #BoonLay and #Queenstown. We encourage fellow commuters to look out for persons with special needs. Please lend a helping hand and approach our station staff if you need further assistance. - SMRT
Hashtags
@sgmrt · Post #2035 · 25.09.2024 г., 04:44
[EWL]:UPDATE Free regular bus & bridging bus services are still available between #BoonLay and #Queenstown. Passengers with special needs, please approach our station staff for assistance. We are working to recover service. - SMRT
Hashtags
@sgmrt · Post #2034 · 25.09.2024 г., 04:24
[EWL]:UPDATE Due to a power fault, there is no train service between #BoonLay and #Queenstown. Free regular bus & bridging bus services are still available between #BoonLay and #Queenstown. We apologies for the inconvenience caused. - SMRT
Hashtags
@sgmrt · Post #2030 · 25.09.2024 г., 03:49
[EWL]:UPDATE Free regular bus & bridging bus services are still available between #BoonLay and #Queenstown. Passengers with special needs, please approach our station staff for assistance. We apologies to affect your commute. - SMRT
Hashtags
@sgmrt · Post #2019 · 25.09.2024 г., 02:09
[EWL]: Due to a power fault, there is no train service between #BoonLay and #Queenstown.Free regular bus & bridging bus services are available between #BoonLay and #Queenstown. - SMRT
Hashtags
@sgmrt · Post #2422 · 06.08.2025 г., 03:14
[EWL] CLEARED: Train services from #BoonLay to #BuonaVista have resumed. Free regular bus & free bridging bus services have ended. We apologise for affecting your commute. - SMRT
Hashtags
@sgmrt · Post #2420 · 06.08.2025 г., 00:39
[EWL] UPDATE: We continue to provide free regular bus and bridging bus services between #BoonLay and #BuonaVista station. - SMRT
Hashtags