Forum Sketchup Artlantis Archicad
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
Annonces
Bonjour Invité Bienvenue sur le forum biblio3d - le forum a été créé le Sam 19 Jan 2008 - 14:26- Nous avons enregistrés 14729 topics pour un total de : 174841 posts - le record de membres connectés simultanément :555
Galerie


 [ SKETCHUP LIVE COMPONENT ] Importer une liste de points dans son graphe via un input texte Empty
Ton bloc notes
Derniers sujets
» [ LUMION ] Lumion 2024
par bruno Mer 24 Avr 2024 - 17:26

» [ SKETCHUP objets ]
par vick Mar 23 Avr 2024 - 20:52

» [ SKETCHUP vray ]
par furax49 Mar 23 Avr 2024 - 19:52

» [ ARTLANTIS ] Ca donne envie !
par loic46 Dim 21 Avr 2024 - 22:56

» [ SKETCHUP généralité ] sortie officielle de sketchup 2024
par tenrev Ven 19 Avr 2024 - 14:24

» [ ARTLANTIS ] Problème origine se déplace
par loic46 Jeu 18 Avr 2024 - 22:28

» [ SKETCHUP plugins ] Vms_up
par Rascal Jeu 18 Avr 2024 - 14:41

» [ SKETCHUP objets ] aquarium
par JDD Lun 15 Avr 2024 - 22:20

» [ ARCHICAD ] raccourci clavier
par VertiKal Ven 12 Avr 2024 - 17:47

» [ ARCHICAD ] Zone - Menu déroulant
par Christophe Fortineau Jeu 11 Avr 2024 - 19:49

» [ MATOS INFORM. ] LICENCES ARCHICAD
par yannickniort Jeu 11 Avr 2024 - 15:00

» [ SKETCHUP généralité ] Servimg Premium pour tous les membres
par tenrev Jeu 11 Avr 2024 - 14:31

» [ SKETCHUP plugins ] Move it
par TF3 Mer 10 Avr 2024 - 10:23

» [ SKETCHUP plugins ] curic 2D export
par tenrev Mar 9 Avr 2024 - 17:41

» [ SKETCHUP plugins ] profil builder 4 est disponible
par furax49 Mar 9 Avr 2024 - 17:00

» [ ARCHICAD ] Torsion sur poteaux
par Ti Pack Mar 9 Avr 2024 - 14:59

» [ PRESENTATION ]
par tenrev Lun 8 Avr 2024 - 8:22

» [ TWINMOTION ] bug d'affichage des textures avec le path tracer
par Gaspard Hauser Ven 5 Avr 2024 - 12:53

» [ TWINMOTION ] eGPU / ralentissement Twinmotion important
par TF3 Mer 3 Avr 2024 - 9:11

» [ TWINMOTION ] twinmotion installée deux fois?
par tenrev Mer 3 Avr 2024 - 8:58

» [ INTELLIGENCE ARTIFICIELLE ] Joyeuses Paques avec sketchup.... diffusion
par tenrev Dim 31 Mar 2024 - 16:32

» [ INTELLIGENCE ARTIFICIELLE ] quelques vidéo de mes tests IA
par simjoubert Ven 29 Mar 2024 - 19:16

» [ SKETCHUP généralité ] Interface réinitialisée totalement suite connexion Trimble
par Shakna Ven 29 Mar 2024 - 15:04

» [ SKETCHUP LIVE COMPONENT ] Importer une liste de points dans son graphe via un input texte
par tenrev Jeu 28 Mar 2024 - 13:30

» [ ARCHICAD-OBJETS GDL ] Sortie de toit TCP (Poujoulat)
par BoTof Lun 25 Mar 2024 - 9:12

» [ SKETCHUP LIVE COMPONENT ] besoin de tuyaux sur les textures random
par tenrev Sam 23 Mar 2024 - 10:35

» [ SKETCHUP composants dynamiques ] Copies de copies
par Manutio Ven 22 Mar 2024 - 12:21

» [ SKETCHUP plugins ] plugin pour les textes
par vick Ven 22 Mar 2024 - 10:34

» [ SKETCHUP généralité ] SÉLECTIONNER - Tuto 4/4 - 2ème TECHNIQUE INÉDITE
par jerryvento Jeu 21 Mar 2024 - 9:08

» [ SKETCHUP tutos ] SÉLECTIONNER - Tuto 4/4 - 2ème TECHNIQUE INÉDITE
par jerryvento Jeu 21 Mar 2024 - 9:07

» [ KEYSHOT ] plugin sketchup
par tenrev Mer 20 Mar 2024 - 8:26

» [ SKETCHUP LIVE COMPONENT ] rendre visible ou invisible un paramètre utilisateur selon des conditions ?
par simjoubert Mar 19 Mar 2024 - 15:38

» [ PRESENTATION ] Manutio
par Manutio Lun 18 Mar 2024 - 9:21

» [ SKETCHUP généralité ] SÉLECTIONNER - Tuto 3/4 - 1ère TECHNIQUE INÉDITE
par JDD Mer 13 Mar 2024 - 10:39

» [ SKETCHUP plugins ] SketchUp et Menuiserie : Rencontre avec Artwood
par art wood concept Mer 13 Mar 2024 - 9:54

Sondage

Chaine Twitch

 [ SKETCHUP LIVE COMPONENT ] Importer une liste de points dans son graphe via un input texte Poll_c1029% [ SKETCHUP LIVE COMPONENT ] Importer une liste de points dans son graphe via un input texte Poll_c10 29% [ 11 ]
 [ SKETCHUP LIVE COMPONENT ] Importer une liste de points dans son graphe via un input texte Poll_c1011% [ SKETCHUP LIVE COMPONENT ] Importer une liste de points dans son graphe via un input texte Poll_c10 11% [ 4 ]
 [ SKETCHUP LIVE COMPONENT ] Importer une liste de points dans son graphe via un input texte Poll_c103% [ SKETCHUP LIVE COMPONENT ] Importer une liste de points dans son graphe via un input texte Poll_c10 3% [ 1 ]
 [ SKETCHUP LIVE COMPONENT ] Importer une liste de points dans son graphe via un input texte Poll_c108% [ SKETCHUP LIVE COMPONENT ] Importer une liste de points dans son graphe via un input texte Poll_c10 8% [ 3 ]
 [ SKETCHUP LIVE COMPONENT ] Importer une liste de points dans son graphe via un input texte Poll_c108% [ SKETCHUP LIVE COMPONENT ] Importer une liste de points dans son graphe via un input texte Poll_c10 8% [ 3 ]
 [ SKETCHUP LIVE COMPONENT ] Importer une liste de points dans son graphe via un input texte Poll_c108% [ SKETCHUP LIVE COMPONENT ] Importer une liste de points dans son graphe via un input texte Poll_c10 8% [ 3 ]
 [ SKETCHUP LIVE COMPONENT ] Importer une liste de points dans son graphe via un input texte Poll_c1029% [ SKETCHUP LIVE COMPONENT ] Importer une liste de points dans son graphe via un input texte Poll_c10 29% [ 11 ]
 [ SKETCHUP LIVE COMPONENT ] Importer une liste de points dans son graphe via un input texte Poll_c105% [ SKETCHUP LIVE COMPONENT ] Importer une liste de points dans son graphe via un input texte Poll_c10 5% [ 2 ]

Total des votes : 38

chaine sketchup.tv
Serveur Discord
Le Deal du moment : -29%
PC portable – MEDION 15,6″ FHD Intel i7 ...
Voir le deal
499.99 €

[ SKETCHUP LIVE COMPONENT ] Importer une liste de points dans son graphe via un input texte

Voir le sujet précédent Voir le sujet suivant Aller en bas

simjoubert
simjoubert
Administrateurs
Administrateurs
Masculin Humeur : Des racines et des rêves !!!
Date d'inscription : 05/08/2012
Nombre de messages : 2824
Points : 6273
Age : 48
Localisation : Val de Marne
Emploi : Paysagiste
https://www.sketchup.simjoubert.com/

Messagesimjoubert Jeu 8 Juin 2023 - 13:30

Hello les amis

Il est actuellement fastidieux d'utiliser des courbes ou des faces existantes dans son modèle pour adapter son live component !

Exemple le tracé de la courbe de l'axe central d'un chemin de point pour modéliser une route, un reseau ferré, le contour d'une terrasse ...
Vous étiez obligé d'exporter la courbe en obj pour l'importer dans Trible Creator.

En attendant l'import de fichiers CSV dans un input, il faut trouver la parade.
En utilisant les nœuds disponibles j'ai réussi à convertir une entrée d'un input texte en liste de vecteurs ! content

voici une petite démo :
 [ SKETCHUP LIVE COMPONENT ] Importer une liste de points dans son graphe via un input texte Chrome_gAYGMsVGvd

Voici le code ruby pour extraire les points d'une face ou les points ordonnés d'une courbe
le graph doit être en unité mm

Code:

# Extract outerloop points position of a face in a selected Component Instance to a string
# x,y,z values are roundes to 1 decimal
# string use different separator for points and values

# How to use
# 1- Draw à face
# 2- Create a Component of the face
# 3- Define the origin of the component it will be the equal at the origin of the graphe
# 4- paste this code in the Ruby Console
# 5- Copy the string result
# 6- Past it in the Live component dialog, in the string input

def stringOuterloop(separatorPoint=";",separatorValue=",")
  
  inst = Sketchup.active_model.selection.grep(Sketchup::ComponentInstance)[0]
  face = inst.definition.entities.grep(Sketchup::Face)[0]
  vertices = face.outer_loop.vertices
  points = vertices.map{|v| v.position}
  points_mm = points.map{|p| "#{p.x.to_mm.round(1)}#{separatorValue}#{p.y.to_mm.round(1)}#{separatorValue}#{p.z.to_mm.round(1)}"}
  points_string = points_mm.join("#{separatorPoint}")
  return points_string
  
end

def stringCurve(separatorPoint=";",separatorValue=",")
  
  inst = Sketchup.active_model.selection.grep(Sketchup::ComponentInstance)[0]
  curve = inst.definition.entities.grep(Sketchup::Edge)[0].curve
  vertices = curve.vertices
  points = vertices.map{|v| v.position}
  points_mm = points.map{|p| "#{p.x.to_mm.round(1)}#{separatorValue}#{p.y.to_mm.round(1)}#{separatorValue}#{p.z.to_mm.round(1)}"}
  points_string = points_mm.join("#{separatorPoint}")
  return points_string
  
end

string = stringCurve()
puts string

une petite démo avec mon live component Terrasse en bois

 [ SKETCHUP LIVE COMPONENT ] Importer une liste de points dans son graphe via un input texte SketchUp_ZvGIsFIuz1

voici le lien vers le graphe :
https://creator.trimble.com/graph?assetURI=whp:34f183e7-a2b1-4d0b-ab52-f8e918b697bf

 [ SKETCHUP LIVE COMPONENT ] Importer une liste de points dans son graphe via un input texte W7AlvnlBlt

Ça vous plait ?
 [ SKETCHUP LIVE COMPONENT ] Importer une liste de points dans son graphe via un input texte IPB_917

tenrev et JDD aiment ce message

tenrev
tenrev
FONDATEUR DE BIBLIO3D
FONDATEUR DE BIBLIO3D
Masculin Humeur : excellente comme toujours
Date d'inscription : 19/01/2008
Nombre de messages : 19778
Points : 34427
Age : 61
Localisation : Dans la quatrieme dimension
Emploi : archi d'intérieur salarié
https://www.biblio3d.com

Messagetenrev Jeu 8 Juin 2023 - 13:42

@simjoubert  [ SKETCHUP LIVE COMPONENT ] Importer une liste de points dans son graphe via un input texte Cloche10

super génial , tu es le meilleur Simon , je vais essayer ca  [ SKETCHUP LIVE COMPONENT ] Importer une liste de points dans son graphe via un input texte Prier11

-------------------------------------------------------------------------------------------------------------------------
je ne sais pas grand chose , mais le peu que je sache , je le partage 
1 PC fixe avec proc Rizen 9 3950X 32 threads - cg nvidia geforce RTX3080  - 64 go de ram DDssd 1To
1 PC portable Lenovo  écran 16''|win11 64 bits| i7 Quad core|ram 32go| CG GFORCE RTX3070 avec 8go
1 casque VR Occulus Rift - 1 vieux PC portable Dell sous Linux Ubuntu 18    1 vieux pc portable HP sous chromebook
Modélisation : Sketchup - Rhino - Pconplanner   Rendu: Enscape - Keyshot - Unreal Engine - Artlantis - Twinmotion   Autres: Photoshop - Illustrator - Indesign - Vidéostudio - After Effect - Première

 [ SKETCHUP LIVE COMPONENT ] Importer une liste de points dans son graphe via un input texte 575088biblio3d
tenrev
tenrev
FONDATEUR DE BIBLIO3D
FONDATEUR DE BIBLIO3D
Masculin Humeur : excellente comme toujours
Date d'inscription : 19/01/2008
Nombre de messages : 19778
Points : 34427
Age : 61
Localisation : Dans la quatrieme dimension
Emploi : archi d'intérieur salarié
https://www.biblio3d.com

Messagetenrev Mar 26 Mar 2024 - 17:40

@simjoubert
salut Simon
hier j'ai essayé ton script , j'ai un message d'erreur dans la console !! peut être je m'y prend mal ?
j'ai testé avec sketchup 2023
a+

-------------------------------------------------------------------------------------------------------------------------
je ne sais pas grand chose , mais le peu que je sache , je le partage 
1 PC fixe avec proc Rizen 9 3950X 32 threads - cg nvidia geforce RTX3080  - 64 go de ram DDssd 1To
1 PC portable Lenovo  écran 16''|win11 64 bits| i7 Quad core|ram 32go| CG GFORCE RTX3070 avec 8go
1 casque VR Occulus Rift - 1 vieux PC portable Dell sous Linux Ubuntu 18    1 vieux pc portable HP sous chromebook
Modélisation : Sketchup - Rhino - Pconplanner   Rendu: Enscape - Keyshot - Unreal Engine - Artlantis - Twinmotion   Autres: Photoshop - Illustrator - Indesign - Vidéostudio - After Effect - Première

 [ SKETCHUP LIVE COMPONENT ] Importer une liste de points dans son graphe via un input texte 575088biblio3d
simjoubert
simjoubert
Administrateurs
Administrateurs
Masculin Humeur : Des racines et des rêves !!!
Date d'inscription : 05/08/2012
Nombre de messages : 2824
Points : 6273
Age : 48
Localisation : Val de Marne
Emploi : Paysagiste
https://www.sketchup.simjoubert.com/

Messagesimjoubert Mer 27 Mar 2024 - 15:46

hello  @tenrev Jack

Le code que j'ai donné contient 2 méthodes

Une pour obtenir les points du contour d'une face à intérieur d'un composant
Code:
string = stringOuterloop()
puts string

Et une pour obtenir les points d'une courbe à intérieur d'un composant
Code:
string = stringCurve()
puts string

Le code est un peu rudimentaire et ne fait aucune vérification


 [ SKETCHUP LIVE COMPONENT ] Importer une liste de points dans son graphe via un input texte IPB_917
simjoubert
simjoubert
Administrateurs
Administrateurs
Masculin Humeur : Des racines et des rêves !!!
Date d'inscription : 05/08/2012
Nombre de messages : 2824
Points : 6273
Age : 48
Localisation : Val de Marne
Emploi : Paysagiste
https://www.sketchup.simjoubert.com/

Messagesimjoubert Mer 27 Mar 2024 - 17:22

Hello
Voici une version améliorée avec des tests de selection et boites de dialogue

Vous pouvez extraire les points de la premiere courbe trouvée ou du contour de la première face trouvée, dans le composant sélectionnée.

Code:
def stringCurve(curves, separatorPoint=";",separatorValue=",")
  size = curves.size
  UI.messagebox("#{ size } curves are found! Only the first will be used." , MB_OK) unless size == 1
  curve = curves[0]
  vertices = curve.vertices
  points = vertices.map{|v| v.position}
  points_mm = points.map{|p| "#{p.x.to_mm.round(1)}#{separatorValue}#{p.y.to_mm.round(1)}#{separatorValue}#{p.z.to_mm.round(1)}"}
  points_string = points_mm.join("#{separatorPoint}")
  return points_string
 
end

def stringOuterloop(faces, separatorPoint=";",separatorValue=",")
  size = faces.size
  UI.messagebox("#{ size } faces are found! Only the first will be used." , MB_OK) unless size == 1
  face = faces[0]
  vertices = face.outer_loop.vertices
  points = vertices.map{|v| v.position}
  points_mm = points.map{|p| "#{p.x.to_mm.round(1)}#{separatorValue}#{p.y.to_mm.round(1)}#{separatorValue}#{p.z.to_mm.round(1)}"}
  points_string = points_mm.join("#{separatorPoint}")
  return points_string
 
end




def getpoints()
  model = Sketchup.active_model
  sel = model.selection
  inst = sel.grep(Sketchup::ComponentInstance)[0]
 
  #test si la selection est vide
  error = 'No component selected'
  UI.messagebox(error , MB_OK) unless inst
  return error unless inst
 
  list = []

  ents = inst.definition.entities
  faces = ents.grep(Sketchup::Face)
  list.append("Outerloop first face in component") if faces.size > 0
 
  edges = ents.grep(Sketchup::Edge)
  curves = []
 
  edges.each do |e|
    curve = e.curve
    curves << curve if curve
  end
  curves = curves.uniq
  puts curves
  list.append("Curve in component") if curves.size > 0
 
  if list == []
    error = "No curve or face in the selected component"
    UI.messagebox(error , MB_OK)
    return error
  end
 
  prompts = ["What type of element do you want to extract the points from?"]
  defaults = [list[0]]
  list_c = [list.join("|")]
  input = UI.inputbox(prompts, defaults, list_c, "Select the source of point")
  puts input
 
  case input[0]
  when "Outerloop first face in component"
    string = stringOuterloop(faces)
  when "Curve in component"
    string = stringCurve(curves)
  end
 
  #string = "No points" if string ==""
  UI.messagebox(string , MB_OK)
  return string
end
points = getpoints()
puts points

 [ SKETCHUP LIVE COMPONENT ] Importer une liste de points dans son graphe via un input texte IPB_917

tenrev aime ce message

tenrev
tenrev
FONDATEUR DE BIBLIO3D
FONDATEUR DE BIBLIO3D
Masculin Humeur : excellente comme toujours
Date d'inscription : 19/01/2008
Nombre de messages : 19778
Points : 34427
Age : 61
Localisation : Dans la quatrieme dimension
Emploi : archi d'intérieur salarié
https://www.biblio3d.com

Messagetenrev Jeu 28 Mar 2024 - 13:30

@simjoubert

super merci Simon , je regarde cela ce weekend bien bravo

-------------------------------------------------------------------------------------------------------------------------
je ne sais pas grand chose , mais le peu que je sache , je le partage 
1 PC fixe avec proc Rizen 9 3950X 32 threads - cg nvidia geforce RTX3080  - 64 go de ram DDssd 1To
1 PC portable Lenovo  écran 16''|win11 64 bits| i7 Quad core|ram 32go| CG GFORCE RTX3070 avec 8go
1 casque VR Occulus Rift - 1 vieux PC portable Dell sous Linux Ubuntu 18    1 vieux pc portable HP sous chromebook
Modélisation : Sketchup - Rhino - Pconplanner   Rendu: Enscape - Keyshot - Unreal Engine - Artlantis - Twinmotion   Autres: Photoshop - Illustrator - Indesign - Vidéostudio - After Effect - Première

 [ SKETCHUP LIVE COMPONENT ] Importer une liste de points dans son graphe via un input texte 575088biblio3d
Contenu sponsorisé

MessageContenu sponsorisé

Voir le sujet précédent Voir le sujet suivant Revenir en haut

Créer un compte ou se connecter pour répondre

Vous devez être membre pour répondre.

S'enregistrer

Rejoignez notre communauté ! C'est facile !


S'enregistrer

Connexion

Vous êtes déjà membre ? Aucun soucis, cliquez ici pour vous connecter.


Connexion

 
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum