Skip to content

Instantly share code, notes, and snippets.

View jirihnidek's full-sized avatar

Jiri Hnidek jirihnidek

View GitHub Profile
@jirihnidek
jirihnidek / .gitignore
Last active July 18, 2024 14:53
Example of (Linux) client-server aplication using ECN bit in UDP packets.
.cproject
.project
build
@jirihnidek
jirihnidek / CMakeLists.txt
Last active August 29, 2015 14:22
Example of IPv4 TCP client-server application(s) using blocking sockets
# Main CMakeFile.txt
# Minimal version of CMake
cmake_minimum_required (VERSION 2.6)
# Build type
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Debug' as none was specified.")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
@jirihnidek
jirihnidek / CMakeLists.txt
Last active December 15, 2024 22:01
Example of IPv6 TCP client-server application(s) using blocking sockets
# Main CMakeFile.txt
# Minimal version of CMake
cmake_minimum_required (VERSION 2.6)
# Build type
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Debug' as none was specified.")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
@jirihnidek
jirihnidek / CMakeLists.txt
Last active November 24, 2019 23:35
Example of IPv6 TCP client-server application(s) using select() and blocking sockets
# Main CMakeFile.txt
# Minimal version of CMake
cmake_minimum_required (VERSION 2.6)
# Build type
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Debug' as none was specified.")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
@jirihnidek
jirihnidek / CMakeLists.txt
Last active November 2, 2021 17:15
C++ OpenCL Example
# Minimal version of CMake
cmake_minimum_required (VERSION 2.6)
# Build type
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Debug' as none was specified.")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release")
endif ()
#!/usr/bin/env python
"""
Simple example of bspline surface created directly (not using Bezier surface)
"""
from OCC.gp import *
from OCC.Geom import *
from OCC.TColGeom import *
from OCC.TColgp import *
@jirihnidek
jirihnidek / CMakeLists.txt
Created July 26, 2016 11:21
OpenCascade Simple Face
# This example shows how to use find_package(OCE) by specifying
# a list of toolkits.
# If a toolkit is missing or if OCE is not found, a fatal error
# is thrown, we do not try to find an Opencascade installation.
cmake_minimum_required(VERSION 2.6)
find_package(OCE REQUIRED)
# Include files reside in ${OCE_INCLUDE_DIRS};
import bpy
import bmesh
obj = bpy.context.active_object
mesh = obj.data
bmsh = bmesh.new()
bmsh.from_mesh(mesh)
# Do something with mesh: e.g. add layer
layer = bmsh.verts.layers.int.new('Example')
for id,vert in enumerate(bmsh.verts):
"""
This simple example of Blender Python script prints membership of verticies in vertex groups and weights. It uses deform layer.
"""
import bpy
import bmesh
obj = bpy.context.object
# Get the active mesh
#include <stdlib.h>
#include <TColgp_Array2OfPnt.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <gp_Pnt.hxx>
#include <TopoDS_Edge.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <TopoDS_Wire.hxx>